content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
def encode_structure_fold(fold, tree): def encode_node(node): if node.is_leaf(): return fold.add('boxEncoder', node.box) elif node.is_adj(): left = encode_node(node.left) right = encode_node(node.right) return fold.add('adjEncoder', left, right) elif node.is_sym(): feature = encode_node(node.left) sym = node.sym return fold.add('symEncoder', feature, sym) encoding = encode_node(tree.root) return fold.add('sampleEncoder', encoding) def decode_structure_fold(fold, feature, tree): def decode_node_box(node, feature): if node.is_leaf(): box = fold.add('boxDecoder', feature) recon_loss = fold.add('boxLossEstimator', box, node.box) label = fold.add('nodeClassifier', feature) label_loss = fold.add('classifyLossEstimator', label, node.label) return fold.add('vectorAdder', recon_loss, label_loss) elif node.is_adj(): left, right = fold.add('adjDecoder', feature).split(2) left_loss = decode_node_box(node.left, left) right_loss = decode_node_box(node.right, right) label = fold.add('nodeClassifier', feature) label_loss = fold.add('classifyLossEstimator', label, node.label) loss = fold.add('vectorAdder', left_loss, right_loss) return fold.add('vectorAdder', loss, label_loss) elif node.is_sym(): sym_gen, sym_param = fold.add('symDecoder', feature).split(2) sym_param_loss = fold.add('symLossEstimator', sym_param, node.sym) sym_gen_loss = decode_node_box(node.left, sym_gen) label = fold.add('nodeClassifier', feature) label_loss = fold.add('classifyLossEstimator', label, node.label) loss = fold.add('vectorAdder', sym_gen_loss, sym_param_loss) return fold.add('vectorAdder', loss, label_loss) feature = fold.add('sampleDecoder', feature) loss = decode_node_box(tree.root, feature) return loss
def encode_structure_fold(fold, tree): def encode_node(node): if node.is_leaf(): return fold.add('boxEncoder', node.box) elif node.is_adj(): left = encode_node(node.left) right = encode_node(node.right) return fold.add('adjEncoder', left, right) elif node.is_sym(): feature = encode_node(node.left) sym = node.sym return fold.add('symEncoder', feature, sym) encoding = encode_node(tree.root) return fold.add('sampleEncoder', encoding) def decode_structure_fold(fold, feature, tree): def decode_node_box(node, feature): if node.is_leaf(): box = fold.add('boxDecoder', feature) recon_loss = fold.add('boxLossEstimator', box, node.box) label = fold.add('nodeClassifier', feature) label_loss = fold.add('classifyLossEstimator', label, node.label) return fold.add('vectorAdder', recon_loss, label_loss) elif node.is_adj(): (left, right) = fold.add('adjDecoder', feature).split(2) left_loss = decode_node_box(node.left, left) right_loss = decode_node_box(node.right, right) label = fold.add('nodeClassifier', feature) label_loss = fold.add('classifyLossEstimator', label, node.label) loss = fold.add('vectorAdder', left_loss, right_loss) return fold.add('vectorAdder', loss, label_loss) elif node.is_sym(): (sym_gen, sym_param) = fold.add('symDecoder', feature).split(2) sym_param_loss = fold.add('symLossEstimator', sym_param, node.sym) sym_gen_loss = decode_node_box(node.left, sym_gen) label = fold.add('nodeClassifier', feature) label_loss = fold.add('classifyLossEstimator', label, node.label) loss = fold.add('vectorAdder', sym_gen_loss, sym_param_loss) return fold.add('vectorAdder', loss, label_loss) feature = fold.add('sampleDecoder', feature) loss = decode_node_box(tree.root, feature) return loss
# -*- coding: utf-8 -*- class TrieNode: def __init__(self): self.children = {} self.leaf = False class Trie: def __init__(self): self.root = TrieNode() def insert(self, word): current = self.root for char in word: if char not in current.children: current.children[char] = TrieNode() current = current.children[char] current.leaf = True def minimumLengthEncoding(self): result = 0 for child in self.root.children: result += self.depthOfLeaves(self.root.children[child], 1) return result def depthOfLeaves(self, current, length): if not current.children: return length + 1 result = 0 for child in current.children: result += self.depthOfLeaves(current.children[child], length + 1) return result class Solution: def minimumLengthEncoding(self, words): trie = Trie() for word in words: trie.insert(word[::-1]) return trie.minimumLengthEncoding() if __name__ == '__main__': solution = Solution() assert 10 == solution.minimumLengthEncoding(['time', 'me', 'bell']) assert 12 == solution.minimumLengthEncoding(['time', 'atime', 'btime'])
class Trienode: def __init__(self): self.children = {} self.leaf = False class Trie: def __init__(self): self.root = trie_node() def insert(self, word): current = self.root for char in word: if char not in current.children: current.children[char] = trie_node() current = current.children[char] current.leaf = True def minimum_length_encoding(self): result = 0 for child in self.root.children: result += self.depthOfLeaves(self.root.children[child], 1) return result def depth_of_leaves(self, current, length): if not current.children: return length + 1 result = 0 for child in current.children: result += self.depthOfLeaves(current.children[child], length + 1) return result class Solution: def minimum_length_encoding(self, words): trie = trie() for word in words: trie.insert(word[::-1]) return trie.minimumLengthEncoding() if __name__ == '__main__': solution = solution() assert 10 == solution.minimumLengthEncoding(['time', 'me', 'bell']) assert 12 == solution.minimumLengthEncoding(['time', 'atime', 'btime'])
# dataset settings dataset_type = 'CUB' img_norm_cfg = dict( mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True) train_pipeline = [ dict(type='LoadImageFromFile'), dict(type='Resize', size=510), dict(type='RandomCrop', size=384), dict(type='RandomFlip', flip_prob=0.5, direction='horizontal'), dict(type='Normalize', **img_norm_cfg), dict(type='ImageToTensor', keys=['img']), dict(type='ToTensor', keys=['gt_label']), dict(type='Collect', keys=['img', 'gt_label']) ] test_pipeline = [ dict(type='LoadImageFromFile'), dict(type='Resize', size=510), dict(type='CenterCrop', crop_size=384), dict(type='Normalize', **img_norm_cfg), dict(type='ImageToTensor', keys=['img']), dict(type='Collect', keys=['img']) ] data_root = 'data/CUB_200_2011/' data = dict( samples_per_gpu=8, workers_per_gpu=2, train=dict( type=dataset_type, ann_file=data_root + 'images.txt', image_class_labels_file=data_root + 'image_class_labels.txt', train_test_split_file=data_root + 'train_test_split.txt', data_prefix=data_root + 'images', pipeline=train_pipeline), val=dict( type=dataset_type, ann_file=data_root + 'images.txt', image_class_labels_file=data_root + 'image_class_labels.txt', train_test_split_file=data_root + 'train_test_split.txt', data_prefix=data_root + 'images', test_mode=True, pipeline=test_pipeline), test=dict( type=dataset_type, ann_file=data_root + 'images.txt', image_class_labels_file=data_root + 'image_class_labels.txt', train_test_split_file=data_root + 'train_test_split.txt', data_prefix=data_root + 'images', test_mode=True, pipeline=test_pipeline)) evaluation = dict( interval=1, metric='accuracy', save_best='auto') # save the checkpoint with highest accuracy
dataset_type = 'CUB' img_norm_cfg = dict(mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True) train_pipeline = [dict(type='LoadImageFromFile'), dict(type='Resize', size=510), dict(type='RandomCrop', size=384), dict(type='RandomFlip', flip_prob=0.5, direction='horizontal'), dict(type='Normalize', **img_norm_cfg), dict(type='ImageToTensor', keys=['img']), dict(type='ToTensor', keys=['gt_label']), dict(type='Collect', keys=['img', 'gt_label'])] test_pipeline = [dict(type='LoadImageFromFile'), dict(type='Resize', size=510), dict(type='CenterCrop', crop_size=384), dict(type='Normalize', **img_norm_cfg), dict(type='ImageToTensor', keys=['img']), dict(type='Collect', keys=['img'])] data_root = 'data/CUB_200_2011/' data = dict(samples_per_gpu=8, workers_per_gpu=2, train=dict(type=dataset_type, ann_file=data_root + 'images.txt', image_class_labels_file=data_root + 'image_class_labels.txt', train_test_split_file=data_root + 'train_test_split.txt', data_prefix=data_root + 'images', pipeline=train_pipeline), val=dict(type=dataset_type, ann_file=data_root + 'images.txt', image_class_labels_file=data_root + 'image_class_labels.txt', train_test_split_file=data_root + 'train_test_split.txt', data_prefix=data_root + 'images', test_mode=True, pipeline=test_pipeline), test=dict(type=dataset_type, ann_file=data_root + 'images.txt', image_class_labels_file=data_root + 'image_class_labels.txt', train_test_split_file=data_root + 'train_test_split.txt', data_prefix=data_root + 'images', test_mode=True, pipeline=test_pipeline)) evaluation = dict(interval=1, metric='accuracy', save_best='auto')
# -*- coding: utf-8 -*- class Config: class MongoDB: database = "crawlib2_test"
class Config: class Mongodb: database = 'crawlib2_test'
months = "JanFebMarAprMayJunJulAugSepOctNovDec" n = int(input("Enter month Number: ")) if (n > 0 and n < 13): mE = (3 * n) mA = mE - 3 print(months[mA:mE]) else: print("falsche Zahl")
months = 'JanFebMarAprMayJunJulAugSepOctNovDec' n = int(input('Enter month Number: ')) if n > 0 and n < 13: m_e = 3 * n m_a = mE - 3 print(months[mA:mE]) else: print('falsche Zahl')
#!python with open('pessoas.csv') as arquivo: with open('pessoas.txt', 'w') as saida: for registro in arquivo: pessoa = registro.strip().split(',') print('Nome:{}, Idade:{}'.format(*pessoa), file=saida) if saida.closed: print('Saida OK') if arquivo.closed: print('saida ok')
with open('pessoas.csv') as arquivo: with open('pessoas.txt', 'w') as saida: for registro in arquivo: pessoa = registro.strip().split(',') print('Nome:{}, Idade:{}'.format(*pessoa), file=saida) if saida.closed: print('Saida OK') if arquivo.closed: print('saida ok')
class ConfigError(Exception): def __init__(self, *args, **kwargs): Exception.__init__(self, *args, **kwargs) class MercuryUnsupportedService(Exception): def __init__(self, *args, **kwargs): Exception.__init__(self, *args, **kwargs) class MercuryConnectException(Exception): def __init__(self, *args, **kwargs): Exception.__init__(self, *args, **kwargs) class MercuriusRequestException(Exception): def __init__(self, *args, **kwargs): Exception.__init__(self, *args, **kwargs) class MercuriusHTTPException(Exception): def __init__(self, *args, **kwargs): Exception.__init__(self, *args, **kwargs) class MercuriusHeaderException(Exception): def __init__(self, *args, **kwargs): Exception.__init__(self, *args, **kwargs)
class Configerror(Exception): def __init__(self, *args, **kwargs): Exception.__init__(self, *args, **kwargs) class Mercuryunsupportedservice(Exception): def __init__(self, *args, **kwargs): Exception.__init__(self, *args, **kwargs) class Mercuryconnectexception(Exception): def __init__(self, *args, **kwargs): Exception.__init__(self, *args, **kwargs) class Mercuriusrequestexception(Exception): def __init__(self, *args, **kwargs): Exception.__init__(self, *args, **kwargs) class Mercuriushttpexception(Exception): def __init__(self, *args, **kwargs): Exception.__init__(self, *args, **kwargs) class Mercuriusheaderexception(Exception): def __init__(self, *args, **kwargs): Exception.__init__(self, *args, **kwargs)
####################################### graph={} graph["start"]["a"]=6 graph["start"]["b"]=2 graph["a"]={} graph["a"]["fin"]=1 graph["b"]={} graph["b"]["a"]=3 graph["b"]["fin"]=5 graph["fin"]={} ####################################### infinity = float("inf") costs={} costs["a"]=6 costs["b"]=2 costs["fin"]=infinity ####################################### ###### parents={} parents["a"]="start" parents["b"]="start" parents["fin"]=None ####################################### processed = [] node = find_lowest_cost_node(costs) while node is not None: cost = costs[node] neightbors = graph[node] for n in neightbors.key(): new_cost = cost+neightbors[n] if costs[n]> new_cost: costs[n]=new_cost parents[n]=node processed.append(node) node = find_lowest_cost_node(costs) def find_lowest_cost_node(costs): lowest_cost = float("inf") lowest_cost_node=None for node in costs: cost = costs[node] if cost < lowest_cost and node not in processed: lowest_cost = cost lowest_cost_node = node return lowest_cost_node
graph = {} graph['start']['a'] = 6 graph['start']['b'] = 2 graph['a'] = {} graph['a']['fin'] = 1 graph['b'] = {} graph['b']['a'] = 3 graph['b']['fin'] = 5 graph['fin'] = {} infinity = float('inf') costs = {} costs['a'] = 6 costs['b'] = 2 costs['fin'] = infinity parents = {} parents['a'] = 'start' parents['b'] = 'start' parents['fin'] = None processed = [] node = find_lowest_cost_node(costs) while node is not None: cost = costs[node] neightbors = graph[node] for n in neightbors.key(): new_cost = cost + neightbors[n] if costs[n] > new_cost: costs[n] = new_cost parents[n] = node processed.append(node) node = find_lowest_cost_node(costs) def find_lowest_cost_node(costs): lowest_cost = float('inf') lowest_cost_node = None for node in costs: cost = costs[node] if cost < lowest_cost and node not in processed: lowest_cost = cost lowest_cost_node = node return lowest_cost_node
## using the return statement in python ## execute fct and give the respond back def cube(num): ## expectin one num return num*num*num ## allows to return value to the caller print(cube(3)) ## return none result = cube(4) print(result)
def cube(num): return num * num * num print(cube(3)) result = cube(4) print(result)
# Used when we want to process an array of requests through a chain of handlers. Respective handler processes the request depending on the value, and send the request to the successor handler if not handled at that handler. class Handler: def __init__(self, successor): self.successor = successor def handle(self, request): handled = self._handle(request) if not handled: print("-- Refering to successor,", request) self.successor.handle(request) def _handle(self, request): raise NotImplementedError("NotImplementedError") class HandlerOne(Handler): def _handle(self, request): if 0 < request < 10: print("Handled by H-One", request) return True class HandlerTwo(Handler): def _handle(self, request): if request < 25: print("Handled by H-Two", request) return True class DefaultHandler(Handler): def _handle(self, request): print("End of chain", request) return True class Client: def __init__(self): self.handler = HandlerOne(HandlerTwo(DefaultHandler(None))) def delegate(self, requests): for r in requests: self.handler.handle(r) c = Client() requests = [1, 2, 3, 24, 30] c.delegate(requests)
class Handler: def __init__(self, successor): self.successor = successor def handle(self, request): handled = self._handle(request) if not handled: print('-- Refering to successor,', request) self.successor.handle(request) def _handle(self, request): raise not_implemented_error('NotImplementedError') class Handlerone(Handler): def _handle(self, request): if 0 < request < 10: print('Handled by H-One', request) return True class Handlertwo(Handler): def _handle(self, request): if request < 25: print('Handled by H-Two', request) return True class Defaulthandler(Handler): def _handle(self, request): print('End of chain', request) return True class Client: def __init__(self): self.handler = handler_one(handler_two(default_handler(None))) def delegate(self, requests): for r in requests: self.handler.handle(r) c = client() requests = [1, 2, 3, 24, 30] c.delegate(requests)
def brac_balance(expr): stack = [] for char in expr: if char in ["(", "{", "["]: stack.append(char) else: if not stack: return False current_char = stack.pop() if current_char == '(': if char != ")": return False if current_char == '{': if char != "}": return False if current_char == '[': if char != "]": return False if stack: return False return True if __name__ == "__main__": expr = input('enter bracs as per your need ') if brac_balance(expr): print("true") else: print('false')
def brac_balance(expr): stack = [] for char in expr: if char in ['(', '{', '[']: stack.append(char) else: if not stack: return False current_char = stack.pop() if current_char == '(': if char != ')': return False if current_char == '{': if char != '}': return False if current_char == '[': if char != ']': return False if stack: return False return True if __name__ == '__main__': expr = input('enter bracs as per your need ') if brac_balance(expr): print('true') else: print('false')
# Stack implementation ''' Stack using python list. Use append to push an item onto the stack and pop to remove an item ''' my_stack = list() my_stack.append(4) my_stack.append(7) my_stack.append(12) my_stack.append(19) print(my_stack) print(my_stack.pop()) # 19 print(my_stack.pop()) # 12 print(my_stack) # [4,7]
""" Stack using python list. Use append to push an item onto the stack and pop to remove an item """ my_stack = list() my_stack.append(4) my_stack.append(7) my_stack.append(12) my_stack.append(19) print(my_stack) print(my_stack.pop()) print(my_stack.pop()) print(my_stack)
class LED_80_64: keySize = 64 T0 = [0x00BB00DD00AA0055, 0x00BA00D100AE0057, 0x00BC00DF00A5005B, 0x00B500D900A7005A, 0x00B100DC00A40052, 0x00B000D000A00050, 0x00B700D200AF005E, 0x00B900D600A20051, 0x00B600DE00AB005C, 0x00BF00D800A9005D, 0x00BD00D300A10059, 0x00B300D700AC0056, 0x00B800DA00A60053, 0x00BE00D400AD005F, 0x00B200DB00A80054, 0x00B400D500A30058, 0x00AB001D00EA0075, 0x00AA001100EE0077, 0x00AC001F00E5007B, 0x00A5001900E7007A, 0x00A1001C00E40072, 0x00A0001000E00070, 0x00A7001200EF007E, 0x00A9001600E20071, 0x00A6001E00EB007C, 0x00AF001800E9007D, 0x00AD001300E10079, 0x00A3001700EC0076, 0x00A8001A00E60073, 0x00AE001400ED007F, 0x00A2001B00E80074, 0x00A4001500E30078, 0x00CB00FD005A00B5, 0x00CA00F1005E00B7, 0x00CC00FF005500BB, 0x00C500F9005700BA, 0x00C100FC005400B2, 0x00C000F0005000B0, 0x00C700F2005F00BE, 0x00C900F6005200B1, 0x00C600FE005B00BC, 0x00CF00F8005900BD, 0x00CD00F3005100B9, 0x00C300F7005C00B6, 0x00C800FA005600B3, 0x00CE00F4005D00BF, 0x00C200FB005800B4, 0x00C400F5005300B8, 0x005B009D007A00A5, 0x005A0091007E00A7, 0x005C009F007500AB, 0x00550099007700AA, 0x0051009C007400A2, 0x00500090007000A0, 0x00570092007F00AE, 0x00590096007200A1, 0x0056009E007B00AC, 0x005F0098007900AD, 0x005D0093007100A9, 0x00530097007C00A6, 0x0058009A007600A3, 0x005E0094007D00AF, 0x0052009B007800A4, 0x00540095007300A8, 0x001B00CD004A0025, 0x001A00C1004E0027, 0x001C00CF0045002B, 0x001500C90047002A, 0x001100CC00440022, 0x001000C000400020, 0x001700C2004F002E, 0x001900C600420021, 0x001600CE004B002C, 0x001F00C80049002D, 0x001D00C300410029, 0x001300C7004C0026, 0x001800CA00460023, 0x001E00C4004D002F, 0x001200CB00480024, 0x001400C500430028, 0x000B000D000A0005, 0x000A0001000E0007, 0x000C000F0005000B, 0x000500090007000A, 0x0001000C00040002, 0x0000000000000000, 0x00070002000F000E, 0x0009000600020001, 0x0006000E000B000C, 0x000F00080009000D, 0x000D000300010009, 0x00030007000C0006, 0x0008000A00060003, 0x000E0004000D000F, 0x0002000B00080004, 0x0004000500030008, 0x007B002D00FA00E5, 0x007A002100FE00E7, 0x007C002F00F500EB, 0x0075002900F700EA, 0x0071002C00F400E2, 0x0070002000F000E0, 0x0077002200FF00EE, 0x0079002600F200E1, 0x0076002E00FB00EC, 0x007F002800F900ED, 0x007D002300F100E9, 0x0073002700FC00E6, 0x0078002A00F600E3, 0x007E002400FD00EF, 0x0072002B00F800E4, 0x0074002500F300E8, 0x009B006D002A0015, 0x009A0061002E0017, 0x009C006F0025001B, 0x009500690027001A, 0x0091006C00240012, 0x0090006000200010, 0x00970062002F001E, 0x0099006600220011, 0x0096006E002B001C, 0x009F00680029001D, 0x009D006300210019, 0x00930067002C0016, 0x0098006A00260013, 0x009E0064002D001F, 0x0092006B00280014, 0x0094006500230018, 0x006B00ED00BA00C5, 0x006A00E100BE00C7, 0x006C00EF00B500CB, 0x006500E900B700CA, 0x006100EC00B400C2, 0x006000E000B000C0, 0x006700E200BF00CE, 0x006900E600B200C1, 0x006600EE00BB00CC, 0x006F00E800B900CD, 0x006D00E300B100C9, 0x006300E700BC00C6, 0x006800EA00B600C3, 0x006E00E400BD00CF, 0x006200EB00B800C4, 0x006400E500B300C8, 0x00FB008D009A00D5, 0x00FA0081009E00D7, 0x00FC008F009500DB, 0x00F50089009700DA, 0x00F1008C009400D2, 0x00F00080009000D0, 0x00F70082009F00DE, 0x00F90086009200D1, 0x00F6008E009B00DC, 0x00FF0088009900DD, 0x00FD0083009100D9, 0x00F30087009C00D6, 0x00F8008A009600D3, 0x00FE0084009D00DF, 0x00F2008B009800D4, 0x00F40085009300D8, 0x00DB003D001A0095, 0x00DA0031001E0097, 0x00DC003F0015009B, 0x00D500390017009A, 0x00D1003C00140092, 0x00D0003000100090, 0x00D70032001F009E, 0x00D9003600120091, 0x00D6003E001B009C, 0x00DF00380019009D, 0x00DD003300110099, 0x00D30037001C0096, 0x00D8003A00160093, 0x00DE0034001D009F, 0x00D2003B00180094, 0x00D4003500130098, 0x003B007D00CA0065, 0x003A007100CE0067, 0x003C007F00C5006B, 0x0035007900C7006A, 0x0031007C00C40062, 0x0030007000C00060, 0x0037007200CF006E, 0x0039007600C20061, 0x0036007E00CB006C, 0x003F007800C9006D, 0x003D007300C10069, 0x0033007700CC0066, 0x0038007A00C60063, 0x003E007400CD006F, 0x0032007B00C80064, 0x0034007500C30068, 0x008B00AD006A0035, 0x008A00A1006E0037, 0x008C00AF0065003B, 0x008500A90067003A, 0x008100AC00640032, 0x008000A000600030, 0x008700A2006F003E, 0x008900A600620031, 0x008600AE006B003C, 0x008F00A80069003D, 0x008D00A300610039, 0x008300A7006C0036, 0x008800AA00660033, 0x008E00A4006D003F, 0x008200AB00680034, 0x008400A500630038, 0x00EB004D00DA00F5, 0x00EA004100DE00F7, 0x00EC004F00D500FB, 0x00E5004900D700FA, 0x00E1004C00D400F2, 0x00E0004000D000F0, 0x00E7004200DF00FE, 0x00E9004600D200F1, 0x00E6004E00DB00FC, 0x00EF004800D900FD, 0x00ED004300D100F9, 0x00E3004700DC00F6, 0x00E8004A00D600F3, 0x00EE004400DD00FF, 0x00E2004B00D800F4, 0x00E4004500D300F8, 0x002B00BD008A0045, 0x002A00B1008E0047, 0x002C00BF0085004B, 0x002500B90087004A, 0x002100BC00840042, 0x002000B000800040, 0x002700B2008F004E, 0x002900B600820041, 0x002600BE008B004C, 0x002F00B80089004D, 0x002D00B300810049, 0x002300B7008C0046, 0x002800BA00860043, 0x002E00B4008D004F, 0x002200BB00880044, 0x002400B500830048, 0x004B005D003A0085, 0x004A0051003E0087, 0x004C005F0035008B, 0x004500590037008A, 0x0041005C00340082, 0x0040005000300080, 0x00470052003F008E, 0x0049005600320081, 0x0046005E003B008C, 0x004F00580039008D, 0x004D005300310089, 0x00430057003C0086, 0x0048005A00360083, 0x004E0054003D008F, 0x0042005B00380084, 0x0044005500330088] T1 = [0xBB00DD00AA005500, 0xBA00D100AE005700, 0xBC00DF00A5005B00, 0xB500D900A7005A00, 0xB100DC00A4005200, 0xB000D000A0005000, 0xB700D200AF005E00, 0xB900D600A2005100, 0xB600DE00AB005C00, 0xBF00D800A9005D00, 0xBD00D300A1005900, 0xB300D700AC005600, 0xB800DA00A6005300, 0xBE00D400AD005F00, 0xB200DB00A8005400, 0xB400D500A3005800, 0xAB001D00EA007500, 0xAA001100EE007700, 0xAC001F00E5007B00, 0xA5001900E7007A00, 0xA1001C00E4007200, 0xA0001000E0007000, 0xA7001200EF007E00, 0xA9001600E2007100, 0xA6001E00EB007C00, 0xAF001800E9007D00, 0xAD001300E1007900, 0xA3001700EC007600, 0xA8001A00E6007300, 0xAE001400ED007F00, 0xA2001B00E8007400, 0xA4001500E3007800, 0xCB00FD005A00B500, 0xCA00F1005E00B700, 0xCC00FF005500BB00, 0xC500F9005700BA00, 0xC100FC005400B200, 0xC000F0005000B000, 0xC700F2005F00BE00, 0xC900F6005200B100, 0xC600FE005B00BC00, 0xCF00F8005900BD00, 0xCD00F3005100B900, 0xC300F7005C00B600, 0xC800FA005600B300, 0xCE00F4005D00BF00, 0xC200FB005800B400, 0xC400F5005300B800, 0x5B009D007A00A500, 0x5A0091007E00A700, 0x5C009F007500AB00, 0x550099007700AA00, 0x51009C007400A200, 0x500090007000A000, 0x570092007F00AE00, 0x590096007200A100, 0x56009E007B00AC00, 0x5F0098007900AD00, 0x5D0093007100A900, 0x530097007C00A600, 0x58009A007600A300, 0x5E0094007D00AF00, 0x52009B007800A400, 0x540095007300A800, 0x1B00CD004A002500, 0x1A00C1004E002700, 0x1C00CF0045002B00, 0x1500C90047002A00, 0x1100CC0044002200, 0x1000C00040002000, 0x1700C2004F002E00, 0x1900C60042002100, 0x1600CE004B002C00, 0x1F00C80049002D00, 0x1D00C30041002900, 0x1300C7004C002600, 0x1800CA0046002300, 0x1E00C4004D002F00, 0x1200CB0048002400, 0x1400C50043002800, 0x0B000D000A000500, 0x0A0001000E000700, 0x0C000F0005000B00, 0x0500090007000A00, 0x01000C0004000200, 0x0000000000000000, 0x070002000F000E00, 0x0900060002000100, 0x06000E000B000C00, 0x0F00080009000D00, 0x0D00030001000900, 0x030007000C000600, 0x08000A0006000300, 0x0E0004000D000F00, 0x02000B0008000400, 0x0400050003000800, 0x7B002D00FA00E500, 0x7A002100FE00E700, 0x7C002F00F500EB00, 0x75002900F700EA00, 0x71002C00F400E200, 0x70002000F000E000, 0x77002200FF00EE00, 0x79002600F200E100, 0x76002E00FB00EC00, 0x7F002800F900ED00, 0x7D002300F100E900, 0x73002700FC00E600, 0x78002A00F600E300, 0x7E002400FD00EF00, 0x72002B00F800E400, 0x74002500F300E800, 0x9B006D002A001500, 0x9A0061002E001700, 0x9C006F0025001B00, 0x9500690027001A00, 0x91006C0024001200, 0x9000600020001000, 0x970062002F001E00, 0x9900660022001100, 0x96006E002B001C00, 0x9F00680029001D00, 0x9D00630021001900, 0x930067002C001600, 0x98006A0026001300, 0x9E0064002D001F00, 0x92006B0028001400, 0x9400650023001800, 0x6B00ED00BA00C500, 0x6A00E100BE00C700, 0x6C00EF00B500CB00, 0x6500E900B700CA00, 0x6100EC00B400C200, 0x6000E000B000C000, 0x6700E200BF00CE00, 0x6900E600B200C100, 0x6600EE00BB00CC00, 0x6F00E800B900CD00, 0x6D00E300B100C900, 0x6300E700BC00C600, 0x6800EA00B600C300, 0x6E00E400BD00CF00, 0x6200EB00B800C400, 0x6400E500B300C800, 0xFB008D009A00D500, 0xFA0081009E00D700, 0xFC008F009500DB00, 0xF50089009700DA00, 0xF1008C009400D200, 0xF00080009000D000, 0xF70082009F00DE00, 0xF90086009200D100, 0xF6008E009B00DC00, 0xFF0088009900DD00, 0xFD0083009100D900, 0xF30087009C00D600, 0xF8008A009600D300, 0xFE0084009D00DF00, 0xF2008B009800D400, 0xF40085009300D800, 0xDB003D001A009500, 0xDA0031001E009700, 0xDC003F0015009B00, 0xD500390017009A00, 0xD1003C0014009200, 0xD000300010009000, 0xD70032001F009E00, 0xD900360012009100, 0xD6003E001B009C00, 0xDF00380019009D00, 0xDD00330011009900, 0xD30037001C009600, 0xD8003A0016009300, 0xDE0034001D009F00, 0xD2003B0018009400, 0xD400350013009800, 0x3B007D00CA006500, 0x3A007100CE006700, 0x3C007F00C5006B00, 0x35007900C7006A00, 0x31007C00C4006200, 0x30007000C0006000, 0x37007200CF006E00, 0x39007600C2006100, 0x36007E00CB006C00, 0x3F007800C9006D00, 0x3D007300C1006900, 0x33007700CC006600, 0x38007A00C6006300, 0x3E007400CD006F00, 0x32007B00C8006400, 0x34007500C3006800, 0x8B00AD006A003500, 0x8A00A1006E003700, 0x8C00AF0065003B00, 0x8500A90067003A00, 0x8100AC0064003200, 0x8000A00060003000, 0x8700A2006F003E00, 0x8900A60062003100, 0x8600AE006B003C00, 0x8F00A80069003D00, 0x8D00A30061003900, 0x8300A7006C003600, 0x8800AA0066003300, 0x8E00A4006D003F00, 0x8200AB0068003400, 0x8400A50063003800, 0xEB004D00DA00F500, 0xEA004100DE00F700, 0xEC004F00D500FB00, 0xE5004900D700FA00, 0xE1004C00D400F200, 0xE0004000D000F000, 0xE7004200DF00FE00, 0xE9004600D200F100, 0xE6004E00DB00FC00, 0xEF004800D900FD00, 0xED004300D100F900, 0xE3004700DC00F600, 0xE8004A00D600F300, 0xEE004400DD00FF00, 0xE2004B00D800F400, 0xE4004500D300F800, 0x2B00BD008A004500, 0x2A00B1008E004700, 0x2C00BF0085004B00, 0x2500B90087004A00, 0x2100BC0084004200, 0x2000B00080004000, 0x2700B2008F004E00, 0x2900B60082004100, 0x2600BE008B004C00, 0x2F00B80089004D00, 0x2D00B30081004900, 0x2300B7008C004600, 0x2800BA0086004300, 0x2E00B4008D004F00, 0x2200BB0088004400, 0x2400B50083004800, 0x4B005D003A008500, 0x4A0051003E008700, 0x4C005F0035008B00, 0x4500590037008A00, 0x41005C0034008200, 0x4000500030008000, 0x470052003F008E00, 0x4900560032008100, 0x46005E003B008C00, 0x4F00580039008D00, 0x4D00530031008900, 0x430057003C008600, 0x48005A0036008300, 0x4E0054003D008F00, 0x42005B0038008400, 0x4400550033008800] T2 = [0xB00B4004E00EC00C, 0xA00B3004D00E500C, 0xC00B2004700E600C, 0x500B8004F00EB00C, 0x100B7004300E900C, 0x000B0004000E000C, 0x700B6004900EA00C, 0x900BA004800ED00C, 0x600B1004A00E300C, 0xF00BB004200EE00C, 0xD00B5004400EF00C, 0x300B9004500E800C, 0x800BD004B00E400C, 0xE00BC004100E700C, 0x200BE004600E100C, 0x400BF004C00E200C, 0xB00A4003E00DC005, 0xA00A3003D00D5005, 0xC00A2003700D6005, 0x500A8003F00DB005, 0x100A7003300D9005, 0x000A0003000D0005, 0x700A6003900DA005, 0x900AA003800DD005, 0x600A1003A00D3005, 0xF00AB003200DE005, 0xD00A5003400DF005, 0x300A9003500D8005, 0x800AD003B00D4005, 0xE00AC003100D7005, 0x200AE003600D1005, 0x400AF003C00D2005, 0xB00C4002E007C006, 0xA00C3002D0075006, 0xC00C200270076006, 0x500C8002F007B006, 0x100C700230079006, 0x000C000200070006, 0x700C60029007A006, 0x900CA0028007D006, 0x600C1002A0073006, 0xF00CB0022007E006, 0xD00C50024007F006, 0x300C900250078006, 0x800CD002B0074006, 0xE00CC00210077006, 0x200CE00260071006, 0x400CF002C0072006, 0xB0054008E00FC00B, 0xA0053008D00F500B, 0xC0052008700F600B, 0x50058008F00FB00B, 0x10057008300F900B, 0x00050008000F000B, 0x70056008900FA00B, 0x9005A008800FD00B, 0x60051008A00F300B, 0xF005B008200FE00B, 0xD0055008400FF00B, 0x30059008500F800B, 0x8005D008B00F400B, 0xE005C008100F700B, 0x2005E008600F100B, 0x4005F008C00F200B, 0xB0014007E003C009, 0xA0013007D0035009, 0xC001200770036009, 0x50018007F003B009, 0x1001700730039009, 0x0001000700030009, 0x700160079003A009, 0x9001A0078003D009, 0x60011007A0033009, 0xF001B0072003E009, 0xD00150074003F009, 0x3001900750038009, 0x8001D007B0034009, 0xE001C00710037009, 0x2001E00760031009, 0x4001F007C0032009, 0xB0004000E000C000, 0xA0003000D0005000, 0xC000200070006000, 0x50008000F000B000, 0x1000700030009000, 0x0000000000000000, 0x700060009000A000, 0x9000A0008000D000, 0x60001000A0003000, 0xF000B0002000E000, 0xD00050004000F000, 0x3000900050008000, 0x8000D000B0004000, 0xE000C00010007000, 0x2000E00060001000, 0x4000F000C0002000, 0xB0074006E009C00A, 0xA0073006D009500A, 0xC00720067009600A, 0x50078006F009B00A, 0x100770063009900A, 0x000700060009000A, 0x700760069009A00A, 0x9007A0068009D00A, 0x60071006A009300A, 0xF007B0062009E00A, 0xD00750064009F00A, 0x300790065009800A, 0x8007D006B009400A, 0xE007C0061009700A, 0x2007E0066009100A, 0x4007F006C009200A, 0xB009400AE008C00D, 0xA009300AD008500D, 0xC009200A7008600D, 0x5009800AF008B00D, 0x1009700A3008900D, 0x0009000A0008000D, 0x7009600A9008A00D, 0x9009A00A8008D00D, 0x6009100AA008300D, 0xF009B00A2008E00D, 0xD009500A4008F00D, 0x3009900A5008800D, 0x8009D00AB008400D, 0xE009C00A1008700D, 0x2009E00A6008100D, 0x4009F00AC008200D, 0xB0064001E00AC003, 0xA0063001D00A5003, 0xC0062001700A6003, 0x50068001F00AB003, 0x10067001300A9003, 0x00060001000A0003, 0x70066001900AA003, 0x9006A001800AD003, 0x60061001A00A3003, 0xF006B001200AE003, 0xD0065001400AF003, 0x30069001500A8003, 0x8006D001B00A4003, 0xE006C001100A7003, 0x2006E001600A1003, 0x4006F001C00A2003, 0xB00F400BE002C00E, 0xA00F300BD002500E, 0xC00F200B7002600E, 0x500F800BF002B00E, 0x100F700B3002900E, 0x000F000B0002000E, 0x700F600B9002A00E, 0x900FA00B8002D00E, 0x600F100BA002300E, 0xF00FB00B2002E00E, 0xD00F500B4002F00E, 0x300F900B5002800E, 0x800FD00BB002400E, 0xE00FC00B1002700E, 0x200FE00B6002100E, 0x400FF00BC002200E, 0xB00D4005E004C00F, 0xA00D3005D004500F, 0xC00D20057004600F, 0x500D8005F004B00F, 0x100D70053004900F, 0x000D00050004000F, 0x700D60059004A00F, 0x900DA0058004D00F, 0x600D1005A004300F, 0xF00DB0052004E00F, 0xD00D50054004F00F, 0x300D90055004800F, 0x800DD005B004400F, 0xE00DC0051004700F, 0x200DE0056004100F, 0x400DF005C004200F, 0xB0034009E005C008, 0xA0033009D0055008, 0xC003200970056008, 0x50038009F005B008, 0x1003700930059008, 0x0003000900050008, 0x700360099005A008, 0x9003A0098005D008, 0x60031009A0053008, 0xF003B0092005E008, 0xD00350094005F008, 0x3003900950058008, 0x8003D009B0054008, 0xE003C00910057008, 0x2003E00960051008, 0x4003F009C0052008, 0xB008400DE00BC004, 0xA008300DD00B5004, 0xC008200D700B6004, 0x5008800DF00BB004, 0x1008700D300B9004, 0x0008000D000B0004, 0x7008600D900BA004, 0x9008A00D800BD004, 0x6008100DA00B3004, 0xF008B00D200BE004, 0xD008500D400BF004, 0x3008900D500B8004, 0x8008D00DB00B4004, 0xE008C00D100B7004, 0x2008E00D600B1004, 0x4008F00DC00B2004, 0xB00E400CE001C007, 0xA00E300CD0015007, 0xC00E200C70016007, 0x500E800CF001B007, 0x100E700C30019007, 0x000E000C00010007, 0x700E600C9001A007, 0x900EA00C8001D007, 0x600E100CA0013007, 0xF00EB00C2001E007, 0xD00E500C4001F007, 0x300E900C50018007, 0x800ED00CB0014007, 0xE00EC00C10017007, 0x200EE00C60011007, 0x400EF00CC0012007, 0xB002400EE006C001, 0xA002300ED0065001, 0xC002200E70066001, 0x5002800EF006B001, 0x1002700E30069001, 0x0002000E00060001, 0x7002600E9006A001, 0x9002A00E8006D001, 0x6002100EA0063001, 0xF002B00E2006E001, 0xD002500E4006F001, 0x3002900E50068001, 0x8002D00EB0064001, 0xE002C00E10067001, 0x2002E00E60061001, 0x4002F00EC0062001, 0xB004400FE00CC002, 0xA004300FD00C5002, 0xC004200F700C6002, 0x5004800FF00CB002, 0x1004700F300C9002, 0x0004000F000C0002, 0x7004600F900CA002, 0x9004A00F800CD002, 0x6004100FA00C3002, 0xF004B00F200CE002, 0xD004500F400CF002, 0x3004900F500C8002, 0x8004D00FB00C4002, 0xE004C00F100C7002, 0x2004E00F600C1002, 0x4004F00FC00C2002] T3 = [0x0BB004400EE00CC0, 0x0BA004300ED00C50, 0x0BC004200E700C60, 0x0B5004800EF00CB0, 0x0B1004700E300C90, 0x0B0004000E000C00, 0x0B7004600E900CA0, 0x0B9004A00E800CD0, 0x0B6004100EA00C30, 0x0BF004B00E200CE0, 0x0BD004500E400CF0, 0x0B3004900E500C80, 0x0B8004D00EB00C40, 0x0BE004C00E100C70, 0x0B2004E00E600C10, 0x0B4004F00EC00C20, 0x0AB003400DE005C0, 0x0AA003300DD00550, 0x0AC003200D700560, 0x0A5003800DF005B0, 0x0A1003700D300590, 0x0A0003000D000500, 0x0A7003600D9005A0, 0x0A9003A00D8005D0, 0x0A6003100DA00530, 0x0AF003B00D2005E0, 0x0AD003500D4005F0, 0x0A3003900D500580, 0x0A8003D00DB00540, 0x0AE003C00D100570, 0x0A2003E00D600510, 0x0A4003F00DC00520, 0x0CB0024007E006C0, 0x0CA0023007D00650, 0x0CC0022007700660, 0x0C50028007F006B0, 0x0C10027007300690, 0x0C00020007000600, 0x0C700260079006A0, 0x0C9002A0078006D0, 0x0C60021007A00630, 0x0CF002B0072006E0, 0x0CD00250074006F0, 0x0C30029007500680, 0x0C8002D007B00640, 0x0CE002C007100670, 0x0C2002E007600610, 0x0C4002F007C00620, 0x05B008400FE00BC0, 0x05A008300FD00B50, 0x05C008200F700B60, 0x055008800FF00BB0, 0x051008700F300B90, 0x050008000F000B00, 0x057008600F900BA0, 0x059008A00F800BD0, 0x056008100FA00B30, 0x05F008B00F200BE0, 0x05D008500F400BF0, 0x053008900F500B80, 0x058008D00FB00B40, 0x05E008C00F100B70, 0x052008E00F600B10, 0x054008F00FC00B20, 0x01B0074003E009C0, 0x01A0073003D00950, 0x01C0072003700960, 0x0150078003F009B0, 0x0110077003300990, 0x0100070003000900, 0x01700760039009A0, 0x019007A0038009D0, 0x0160071003A00930, 0x01F007B0032009E0, 0x01D00750034009F0, 0x0130079003500980, 0x018007D003B00940, 0x01E007C003100970, 0x012007E003600910, 0x014007F003C00920, 0x00B0004000E000C0, 0x00A0003000D00050, 0x00C0002000700060, 0x0050008000F000B0, 0x0010007000300090, 0x0000000000000000, 0x00700060009000A0, 0x009000A0008000D0, 0x0060001000A00030, 0x00F000B0002000E0, 0x00D00050004000F0, 0x0030009000500080, 0x008000D000B00040, 0x00E000C000100070, 0x002000E000600010, 0x004000F000C00020, 0x07B0064009E00AC0, 0x07A0063009D00A50, 0x07C0062009700A60, 0x0750068009F00AB0, 0x0710067009300A90, 0x0700060009000A00, 0x0770066009900AA0, 0x079006A009800AD0, 0x0760061009A00A30, 0x07F006B009200AE0, 0x07D0065009400AF0, 0x0730069009500A80, 0x078006D009B00A40, 0x07E006C009100A70, 0x072006E009600A10, 0x074006F009C00A20, 0x09B00A4008E00DC0, 0x09A00A3008D00D50, 0x09C00A2008700D60, 0x09500A8008F00DB0, 0x09100A7008300D90, 0x09000A0008000D00, 0x09700A6008900DA0, 0x09900AA008800DD0, 0x09600A1008A00D30, 0x09F00AB008200DE0, 0x09D00A5008400DF0, 0x09300A9008500D80, 0x09800AD008B00D40, 0x09E00AC008100D70, 0x09200AE008600D10, 0x09400AF008C00D20, 0x06B001400AE003C0, 0x06A001300AD00350, 0x06C001200A700360, 0x065001800AF003B0, 0x061001700A300390, 0x060001000A000300, 0x067001600A9003A0, 0x069001A00A8003D0, 0x066001100AA00330, 0x06F001B00A2003E0, 0x06D001500A4003F0, 0x063001900A500380, 0x068001D00AB00340, 0x06E001C00A100370, 0x062001E00A600310, 0x064001F00AC00320, 0x0FB00B4002E00EC0, 0x0FA00B3002D00E50, 0x0FC00B2002700E60, 0x0F500B8002F00EB0, 0x0F100B7002300E90, 0x0F000B0002000E00, 0x0F700B6002900EA0, 0x0F900BA002800ED0, 0x0F600B1002A00E30, 0x0FF00BB002200EE0, 0x0FD00B5002400EF0, 0x0F300B9002500E80, 0x0F800BD002B00E40, 0x0FE00BC002100E70, 0x0F200BE002600E10, 0x0F400BF002C00E20, 0x0DB0054004E00FC0, 0x0DA0053004D00F50, 0x0DC0052004700F60, 0x0D50058004F00FB0, 0x0D10057004300F90, 0x0D00050004000F00, 0x0D70056004900FA0, 0x0D9005A004800FD0, 0x0D60051004A00F30, 0x0DF005B004200FE0, 0x0DD0055004400FF0, 0x0D30059004500F80, 0x0D8005D004B00F40, 0x0DE005C004100F70, 0x0D2005E004600F10, 0x0D4005F004C00F20, 0x03B0094005E008C0, 0x03A0093005D00850, 0x03C0092005700860, 0x0350098005F008B0, 0x0310097005300890, 0x0300090005000800, 0x03700960059008A0, 0x039009A0058008D0, 0x0360091005A00830, 0x03F009B0052008E0, 0x03D00950054008F0, 0x0330099005500880, 0x038009D005B00840, 0x03E009C005100870, 0x032009E005600810, 0x034009F005C00820, 0x08B00D400BE004C0, 0x08A00D300BD00450, 0x08C00D200B700460, 0x08500D800BF004B0, 0x08100D700B300490, 0x08000D000B000400, 0x08700D600B9004A0, 0x08900DA00B8004D0, 0x08600D100BA00430, 0x08F00DB00B2004E0, 0x08D00D500B4004F0, 0x08300D900B500480, 0x08800DD00BB00440, 0x08E00DC00B100470, 0x08200DE00B600410, 0x08400DF00BC00420, 0x0EB00C4001E007C0, 0x0EA00C3001D00750, 0x0EC00C2001700760, 0x0E500C8001F007B0, 0x0E100C7001300790, 0x0E000C0001000700, 0x0E700C60019007A0, 0x0E900CA0018007D0, 0x0E600C1001A00730, 0x0EF00CB0012007E0, 0x0ED00C50014007F0, 0x0E300C9001500780, 0x0E800CD001B00740, 0x0EE00CC001100770, 0x0E200CE001600710, 0x0E400CF001C00720, 0x02B00E4006E001C0, 0x02A00E3006D00150, 0x02C00E2006700160, 0x02500E8006F001B0, 0x02100E7006300190, 0x02000E0006000100, 0x02700E60069001A0, 0x02900EA0068001D0, 0x02600E1006A00130, 0x02F00EB0062001E0, 0x02D00E50064001F0, 0x02300E9006500180, 0x02800ED006B00140, 0x02E00EC006100170, 0x02200EE006600110, 0x02400EF006C00120, 0x04B00F400CE002C0, 0x04A00F300CD00250, 0x04C00F200C700260, 0x04500F800CF002B0, 0x04100F700C300290, 0x04000F000C000200, 0x04700F600C9002A0, 0x04900FA00C8002D0, 0x04600F100CA00230, 0x04F00FB00C2002E0, 0x04D00F500C4002F0, 0x04300F900C500280, 0x04800FD00CB00240, 0x04E00FC00C100270, 0x04200FE00C600210, 0x04400FF00CC00220] T4 = [0x880011009900BB00, 0x860014009200BA00, 0x840019009D00BC00, 0x830012009100B500, 0x8E0015009B00B100, 0x800010009000B000, 0x8C0018009400B700, 0x87001B009C00B900, 0x82001D009F00B600, 0x850016009300BF00, 0x8A001C009600BD00, 0x81001F009E00B300, 0x89001E009700B800, 0x8B0013009800BE00, 0x8F001A009500B200, 0x8D0017009A00B400, 0x680041002900AB00, 0x660044002200AA00, 0x640049002D00AC00, 0x630042002100A500, 0x6E0045002B00A100, 0x600040002000A000, 0x6C0048002400A700, 0x67004B002C00A900, 0x62004D002F00A600, 0x650046002300AF00, 0x6A004C002600AD00, 0x61004F002E00A300, 0x69004E002700A800, 0x6B0043002800AE00, 0x6F004A002500A200, 0x6D0047002A00A400, 0x48009100D900CB00, 0x46009400D200CA00, 0x44009900DD00CC00, 0x43009200D100C500, 0x4E009500DB00C100, 0x40009000D000C000, 0x4C009800D400C700, 0x47009B00DC00C900, 0x42009D00DF00C600, 0x45009600D300CF00, 0x4A009C00D600CD00, 0x41009F00DE00C300, 0x49009E00D700C800, 0x4B009300D800CE00, 0x4F009A00D500C200, 0x4D009700DA00C400, 0x3800210019005B00, 0x3600240012005A00, 0x340029001D005C00, 0x3300220011005500, 0x3E0025001B005100, 0x3000200010005000, 0x3C00280014005700, 0x37002B001C005900, 0x32002D001F005600, 0x3500260013005F00, 0x3A002C0016005D00, 0x31002F001E005300, 0x39002E0017005800, 0x3B00230018005E00, 0x3F002A0015005200, 0x3D0027001A005400, 0xE8005100B9001B00, 0xE6005400B2001A00, 0xE4005900BD001C00, 0xE3005200B1001500, 0xEE005500BB001100, 0xE0005000B0001000, 0xEC005800B4001700, 0xE7005B00BC001900, 0xE2005D00BF001600, 0xE5005600B3001F00, 0xEA005C00B6001D00, 0xE1005F00BE001300, 0xE9005E00B7001800, 0xEB005300B8001E00, 0xEF005A00B5001200, 0xED005700BA001400, 0x0800010009000B00, 0x0600040002000A00, 0x040009000D000C00, 0x0300020001000500, 0x0E0005000B000100, 0x0000000000000000, 0x0C00080004000700, 0x07000B000C000900, 0x02000D000F000600, 0x0500060003000F00, 0x0A000C0006000D00, 0x01000F000E000300, 0x09000E0007000800, 0x0B00030008000E00, 0x0F000A0005000200, 0x0D0007000A000400, 0xC800810049007B00, 0xC600840042007A00, 0xC40089004D007C00, 0xC300820041007500, 0xCE0085004B007100, 0xC000800040007000, 0xCC00880044007700, 0xC7008B004C007900, 0xC2008D004F007600, 0xC500860043007F00, 0xCA008C0046007D00, 0xC1008F004E007300, 0xC9008E0047007800, 0xCB00830048007E00, 0xCF008A0045007200, 0xCD0087004A007400, 0x7800B100C9009B00, 0x7600B400C2009A00, 0x7400B900CD009C00, 0x7300B200C1009500, 0x7E00B500CB009100, 0x7000B000C0009000, 0x7C00B800C4009700, 0x7700BB00CC009900, 0x7200BD00CF009600, 0x7500B600C3009F00, 0x7A00BC00C6009D00, 0x7100BF00CE009300, 0x7900BE00C7009800, 0x7B00B300C8009E00, 0x7F00BA00C5009200, 0x7D00B700CA009400, 0x2800D100F9006B00, 0x2600D400F2006A00, 0x2400D900FD006C00, 0x2300D200F1006500, 0x2E00D500FB006100, 0x2000D000F0006000, 0x2C00D800F4006700, 0x2700DB00FC006900, 0x2200DD00FF006600, 0x2500D600F3006F00, 0x2A00DC00F6006D00, 0x2100DF00FE006300, 0x2900DE00F7006800, 0x2B00D300F8006E00, 0x2F00DA00F5006200, 0x2D00D700FA006400, 0x580061003900FB00, 0x560064003200FA00, 0x540069003D00FC00, 0x530062003100F500, 0x5E0065003B00F100, 0x500060003000F000, 0x5C0068003400F700, 0x57006B003C00F900, 0x52006D003F00F600, 0x550066003300FF00, 0x5A006C003600FD00, 0x51006F003E00F300, 0x59006E003700F800, 0x5B0063003800FE00, 0x5F006A003500F200, 0x5D0067003A00F400, 0xA800C1006900DB00, 0xA600C4006200DA00, 0xA400C9006D00DC00, 0xA300C2006100D500, 0xAE00C5006B00D100, 0xA000C0006000D000, 0xAC00C8006400D700, 0xA700CB006C00D900, 0xA200CD006F00D600, 0xA500C6006300DF00, 0xAA00CC006600DD00, 0xA100CF006E00D300, 0xA900CE006700D800, 0xAB00C3006800DE00, 0xAF00CA006500D200, 0xAD00C7006A00D400, 0x1800F100E9003B00, 0x1600F400E2003A00, 0x1400F900ED003C00, 0x1300F200E1003500, 0x1E00F500EB003100, 0x1000F000E0003000, 0x1C00F800E4003700, 0x1700FB00EC003900, 0x1200FD00EF003600, 0x1500F600E3003F00, 0x1A00FC00E6003D00, 0x1100FF00EE003300, 0x1900FE00E7003800, 0x1B00F300E8003E00, 0x1F00FA00E5003200, 0x1D00F700EA003400, 0x9800E10079008B00, 0x9600E40072008A00, 0x9400E9007D008C00, 0x9300E20071008500, 0x9E00E5007B008100, 0x9000E00070008000, 0x9C00E80074008700, 0x9700EB007C008900, 0x9200ED007F008600, 0x9500E60073008F00, 0x9A00EC0076008D00, 0x9100EF007E008300, 0x9900EE0077008800, 0x9B00E30078008E00, 0x9F00EA0075008200, 0x9D00E7007A008400, 0xB80031008900EB00, 0xB60034008200EA00, 0xB40039008D00EC00, 0xB30032008100E500, 0xBE0035008B00E100, 0xB00030008000E000, 0xBC0038008400E700, 0xB7003B008C00E900, 0xB2003D008F00E600, 0xB50036008300EF00, 0xBA003C008600ED00, 0xB1003F008E00E300, 0xB9003E008700E800, 0xBB0033008800EE00, 0xBF003A008500E200, 0xBD0037008A00E400, 0xF800A10059002B00, 0xF600A40052002A00, 0xF400A9005D002C00, 0xF300A20051002500, 0xFE00A5005B002100, 0xF000A00050002000, 0xFC00A80054002700, 0xF700AB005C002900, 0xF200AD005F002600, 0xF500A60053002F00, 0xFA00AC0056002D00, 0xF100AF005E002300, 0xF900AE0057002800, 0xFB00A30058002E00, 0xFF00AA0055002200, 0xFD00A7005A002400, 0xD8007100A9004B00, 0xD6007400A2004A00, 0xD4007900AD004C00, 0xD3007200A1004500, 0xDE007500AB004100, 0xD0007000A0004000, 0xDC007800A4004700, 0xD7007B00AC004900, 0xD2007D00AF004600, 0xD5007600A3004F00, 0xDA007C00A6004D00, 0xD1007F00AE004300, 0xD9007E00A7004800, 0xDB007300A8004E00, 0xDF007A00A5004200, 0xDD007700AA004400] T5 = [0x00880011009900BB, 0x00860014009200BA, 0x00840019009D00BC, 0x00830012009100B5, 0x008E0015009B00B1, 0x00800010009000B0, 0x008C0018009400B7, 0x0087001B009C00B9, 0x0082001D009F00B6, 0x00850016009300BF, 0x008A001C009600BD, 0x0081001F009E00B3, 0x0089001E009700B8, 0x008B0013009800BE, 0x008F001A009500B2, 0x008D0017009A00B4, 0x00680041002900AB, 0x00660044002200AA, 0x00640049002D00AC, 0x00630042002100A5, 0x006E0045002B00A1, 0x00600040002000A0, 0x006C0048002400A7, 0x0067004B002C00A9, 0x0062004D002F00A6, 0x00650046002300AF, 0x006A004C002600AD, 0x0061004F002E00A3, 0x0069004E002700A8, 0x006B0043002800AE, 0x006F004A002500A2, 0x006D0047002A00A4, 0x0048009100D900CB, 0x0046009400D200CA, 0x0044009900DD00CC, 0x0043009200D100C5, 0x004E009500DB00C1, 0x0040009000D000C0, 0x004C009800D400C7, 0x0047009B00DC00C9, 0x0042009D00DF00C6, 0x0045009600D300CF, 0x004A009C00D600CD, 0x0041009F00DE00C3, 0x0049009E00D700C8, 0x004B009300D800CE, 0x004F009A00D500C2, 0x004D009700DA00C4, 0x003800210019005B, 0x003600240012005A, 0x00340029001D005C, 0x0033002200110055, 0x003E0025001B0051, 0x0030002000100050, 0x003C002800140057, 0x0037002B001C0059, 0x0032002D001F0056, 0x003500260013005F, 0x003A002C0016005D, 0x0031002F001E0053, 0x0039002E00170058, 0x003B00230018005E, 0x003F002A00150052, 0x003D0027001A0054, 0x00E8005100B9001B, 0x00E6005400B2001A, 0x00E4005900BD001C, 0x00E3005200B10015, 0x00EE005500BB0011, 0x00E0005000B00010, 0x00EC005800B40017, 0x00E7005B00BC0019, 0x00E2005D00BF0016, 0x00E5005600B3001F, 0x00EA005C00B6001D, 0x00E1005F00BE0013, 0x00E9005E00B70018, 0x00EB005300B8001E, 0x00EF005A00B50012, 0x00ED005700BA0014, 0x000800010009000B, 0x000600040002000A, 0x00040009000D000C, 0x0003000200010005, 0x000E0005000B0001, 0x0000000000000000, 0x000C000800040007, 0x0007000B000C0009, 0x0002000D000F0006, 0x000500060003000F, 0x000A000C0006000D, 0x0001000F000E0003, 0x0009000E00070008, 0x000B00030008000E, 0x000F000A00050002, 0x000D0007000A0004, 0x00C800810049007B, 0x00C600840042007A, 0x00C40089004D007C, 0x00C3008200410075, 0x00CE0085004B0071, 0x00C0008000400070, 0x00CC008800440077, 0x00C7008B004C0079, 0x00C2008D004F0076, 0x00C500860043007F, 0x00CA008C0046007D, 0x00C1008F004E0073, 0x00C9008E00470078, 0x00CB00830048007E, 0x00CF008A00450072, 0x00CD0087004A0074, 0x007800B100C9009B, 0x007600B400C2009A, 0x007400B900CD009C, 0x007300B200C10095, 0x007E00B500CB0091, 0x007000B000C00090, 0x007C00B800C40097, 0x007700BB00CC0099, 0x007200BD00CF0096, 0x007500B600C3009F, 0x007A00BC00C6009D, 0x007100BF00CE0093, 0x007900BE00C70098, 0x007B00B300C8009E, 0x007F00BA00C50092, 0x007D00B700CA0094, 0x002800D100F9006B, 0x002600D400F2006A, 0x002400D900FD006C, 0x002300D200F10065, 0x002E00D500FB0061, 0x002000D000F00060, 0x002C00D800F40067, 0x002700DB00FC0069, 0x002200DD00FF0066, 0x002500D600F3006F, 0x002A00DC00F6006D, 0x002100DF00FE0063, 0x002900DE00F70068, 0x002B00D300F8006E, 0x002F00DA00F50062, 0x002D00D700FA0064, 0x00580061003900FB, 0x00560064003200FA, 0x00540069003D00FC, 0x00530062003100F5, 0x005E0065003B00F1, 0x00500060003000F0, 0x005C0068003400F7, 0x0057006B003C00F9, 0x0052006D003F00F6, 0x00550066003300FF, 0x005A006C003600FD, 0x0051006F003E00F3, 0x0059006E003700F8, 0x005B0063003800FE, 0x005F006A003500F2, 0x005D0067003A00F4, 0x00A800C1006900DB, 0x00A600C4006200DA, 0x00A400C9006D00DC, 0x00A300C2006100D5, 0x00AE00C5006B00D1, 0x00A000C0006000D0, 0x00AC00C8006400D7, 0x00A700CB006C00D9, 0x00A200CD006F00D6, 0x00A500C6006300DF, 0x00AA00CC006600DD, 0x00A100CF006E00D3, 0x00A900CE006700D8, 0x00AB00C3006800DE, 0x00AF00CA006500D2, 0x00AD00C7006A00D4, 0x001800F100E9003B, 0x001600F400E2003A, 0x001400F900ED003C, 0x001300F200E10035, 0x001E00F500EB0031, 0x001000F000E00030, 0x001C00F800E40037, 0x001700FB00EC0039, 0x001200FD00EF0036, 0x001500F600E3003F, 0x001A00FC00E6003D, 0x001100FF00EE0033, 0x001900FE00E70038, 0x001B00F300E8003E, 0x001F00FA00E50032, 0x001D00F700EA0034, 0x009800E10079008B, 0x009600E40072008A, 0x009400E9007D008C, 0x009300E200710085, 0x009E00E5007B0081, 0x009000E000700080, 0x009C00E800740087, 0x009700EB007C0089, 0x009200ED007F0086, 0x009500E60073008F, 0x009A00EC0076008D, 0x009100EF007E0083, 0x009900EE00770088, 0x009B00E30078008E, 0x009F00EA00750082, 0x009D00E7007A0084, 0x00B80031008900EB, 0x00B60034008200EA, 0x00B40039008D00EC, 0x00B30032008100E5, 0x00BE0035008B00E1, 0x00B00030008000E0, 0x00BC0038008400E7, 0x00B7003B008C00E9, 0x00B2003D008F00E6, 0x00B50036008300EF, 0x00BA003C008600ED, 0x00B1003F008E00E3, 0x00B9003E008700E8, 0x00BB0033008800EE, 0x00BF003A008500E2, 0x00BD0037008A00E4, 0x00F800A10059002B, 0x00F600A40052002A, 0x00F400A9005D002C, 0x00F300A200510025, 0x00FE00A5005B0021, 0x00F000A000500020, 0x00FC00A800540027, 0x00F700AB005C0029, 0x00F200AD005F0026, 0x00F500A60053002F, 0x00FA00AC0056002D, 0x00F100AF005E0023, 0x00F900AE00570028, 0x00FB00A30058002E, 0x00FF00AA00550022, 0x00FD00A7005A0024, 0x00D8007100A9004B, 0x00D6007400A2004A, 0x00D4007900AD004C, 0x00D3007200A10045, 0x00DE007500AB0041, 0x00D0007000A00040, 0x00DC007800A40047, 0x00D7007B00AC0049, 0x00D2007D00AF0046, 0x00D5007600A3004F, 0x00DA007C00A6004D, 0x00D1007F00AE0043, 0x00D9007E00A70048, 0x00DB007300A8004E, 0x00DF007A00A50042, 0x00DD007700AA0044] T6 = [0x0DD006600EE00BB0, 0x0D1006B00ED00BA0, 0x0DF006300E700BC0, 0x0D9006C00EF00B50, 0x0DC006D00E300B10, 0x0D0006000E000B00, 0x0D2006500E900B70, 0x0D6006F00E800B90, 0x0DE006800EA00B60, 0x0D8006700E200BF0, 0x0D3006E00E400BD0, 0x0D7006400E500B30, 0x0DA006200EB00B80, 0x0D4006A00E100BE0, 0x0DB006900E600B20, 0x0D5006100EC00B40, 0x01D00B600DE00AB0, 0x01100BB00DD00AA0, 0x01F00B300D700AC0, 0x01900BC00DF00A50, 0x01C00BD00D300A10, 0x01000B000D000A00, 0x01200B500D900A70, 0x01600BF00D800A90, 0x01E00B800DA00A60, 0x01800B700D200AF0, 0x01300BE00D400AD0, 0x01700B400D500A30, 0x01A00B200DB00A80, 0x01400BA00D100AE0, 0x01B00B900D600A20, 0x01500B100DC00A40, 0x0FD0036007E00CB0, 0x0F1003B007D00CA0, 0x0FF0033007700CC0, 0x0F9003C007F00C50, 0x0FC003D007300C10, 0x0F00030007000C00, 0x0F20035007900C70, 0x0F6003F007800C90, 0x0FE0038007A00C60, 0x0F80037007200CF0, 0x0F3003E007400CD0, 0x0F70034007500C30, 0x0FA0032007B00C80, 0x0F4003A007100CE0, 0x0FB0039007600C20, 0x0F50031007C00C40, 0x09D00C600FE005B0, 0x09100CB00FD005A0, 0x09F00C300F7005C0, 0x09900CC00FF00550, 0x09C00CD00F300510, 0x09000C000F000500, 0x09200C500F900570, 0x09600CF00F800590, 0x09E00C800FA00560, 0x09800C700F2005F0, 0x09300CE00F4005D0, 0x09700C400F500530, 0x09A00C200FB00580, 0x09400CA00F1005E0, 0x09B00C900F600520, 0x09500C100FC00540, 0x0CD00D6003E001B0, 0x0C100DB003D001A0, 0x0CF00D30037001C0, 0x0C900DC003F00150, 0x0CC00DD003300110, 0x0C000D0003000100, 0x0C200D5003900170, 0x0C600DF003800190, 0x0CE00D8003A00160, 0x0C800D70032001F0, 0x0C300DE0034001D0, 0x0C700D4003500130, 0x0CA00D2003B00180, 0x0C400DA0031001E0, 0x0CB00D9003600120, 0x0C500D1003C00140, 0x00D0006000E000B0, 0x001000B000D000A0, 0x00F00030007000C0, 0x009000C000F00050, 0x00C000D000300010, 0x0000000000000000, 0x0020005000900070, 0x006000F000800090, 0x00E0008000A00060, 0x00800070002000F0, 0x003000E0004000D0, 0x0070004000500030, 0x00A0002000B00080, 0x004000A0001000E0, 0x00B0009000600020, 0x0050001000C00040, 0x02D0056009E007B0, 0x021005B009D007A0, 0x02F00530097007C0, 0x029005C009F00750, 0x02C005D009300710, 0x0200050009000700, 0x0220055009900770, 0x026005F009800790, 0x02E0058009A00760, 0x02800570092007F0, 0x023005E0094007D0, 0x0270054009500730, 0x02A0052009B00780, 0x024005A0091007E0, 0x02B0059009600720, 0x0250051009C00740, 0x06D00F6008E009B0, 0x06100FB008D009A0, 0x06F00F30087009C0, 0x06900FC008F00950, 0x06C00FD008300910, 0x06000F0008000900, 0x06200F5008900970, 0x06600FF008800990, 0x06E00F8008A00960, 0x06800F70082009F0, 0x06300FE0084009D0, 0x06700F4008500930, 0x06A00F2008B00980, 0x06400FA0081009E0, 0x06B00F9008600920, 0x06500F1008C00940, 0x0ED008600AE006B0, 0x0E1008B00AD006A0, 0x0EF008300A7006C0, 0x0E9008C00AF00650, 0x0EC008D00A300610, 0x0E0008000A000600, 0x0E2008500A900670, 0x0E6008F00A800690, 0x0EE008800AA00660, 0x0E8008700A2006F0, 0x0E3008E00A4006D0, 0x0E7008400A500630, 0x0EA008200AB00680, 0x0E4008A00A1006E0, 0x0EB008900A600620, 0x0E5008100AC00640, 0x08D0076002E00FB0, 0x081007B002D00FA0, 0x08F0073002700FC0, 0x089007C002F00F50, 0x08C007D002300F10, 0x0800070002000F00, 0x0820075002900F70, 0x086007F002800F90, 0x08E0078002A00F60, 0x0880077002200FF0, 0x083007E002400FD0, 0x0870074002500F30, 0x08A0072002B00F80, 0x084007A002100FE0, 0x08B0079002600F20, 0x0850071002C00F40, 0x03D00E6004E00DB0, 0x03100EB004D00DA0, 0x03F00E3004700DC0, 0x03900EC004F00D50, 0x03C00ED004300D10, 0x03000E0004000D00, 0x03200E5004900D70, 0x03600EF004800D90, 0x03E00E8004A00D60, 0x03800E7004200DF0, 0x03300EE004400DD0, 0x03700E4004500D30, 0x03A00E2004B00D80, 0x03400EA004100DE0, 0x03B00E9004600D20, 0x03500E1004C00D40, 0x07D0046005E003B0, 0x071004B005D003A0, 0x07F00430057003C0, 0x079004C005F00350, 0x07C004D005300310, 0x0700040005000300, 0x0720045005900370, 0x076004F005800390, 0x07E0048005A00360, 0x07800470052003F0, 0x073004E0054003D0, 0x0770044005500330, 0x07A0042005B00380, 0x074004A0051003E0, 0x07B0049005600320, 0x0750041005C00340, 0x0AD002600BE008B0, 0x0A1002B00BD008A0, 0x0AF002300B7008C0, 0x0A9002C00BF00850, 0x0AC002D00B300810, 0x0A0002000B000800, 0x0A2002500B900870, 0x0A6002F00B800890, 0x0AE002800BA00860, 0x0A8002700B2008F0, 0x0A3002E00B4008D0, 0x0A7002400B500830, 0x0AA002200BB00880, 0x0A4002A00B1008E0, 0x0AB002900B600820, 0x0A5002100BC00840, 0x04D00A6001E00EB0, 0x04100AB001D00EA0, 0x04F00A3001700EC0, 0x04900AC001F00E50, 0x04C00AD001300E10, 0x04000A0001000E00, 0x04200A5001900E70, 0x04600AF001800E90, 0x04E00A8001A00E60, 0x04800A7001200EF0, 0x04300AE001400ED0, 0x04700A4001500E30, 0x04A00A2001B00E80, 0x04400AA001100EE0, 0x04B00A9001600E20, 0x04500A1001C00E40, 0x0BD0096006E002B0, 0x0B1009B006D002A0, 0x0BF00930067002C0, 0x0B9009C006F00250, 0x0BC009D006300210, 0x0B00090006000200, 0x0B20095006900270, 0x0B6009F006800290, 0x0BE0098006A00260, 0x0B800970062002F0, 0x0B3009E0064002D0, 0x0B70094006500230, 0x0BA0092006B00280, 0x0B4009A0061002E0, 0x0BB0099006600220, 0x0B50091006C00240, 0x05D001600CE004B0, 0x051001B00CD004A0, 0x05F001300C7004C0, 0x059001C00CF00450, 0x05C001D00C300410, 0x050001000C000400, 0x052001500C900470, 0x056001F00C800490, 0x05E001800CA00460, 0x058001700C2004F0, 0x053001E00C4004D0, 0x057001400C500430, 0x05A001200CB00480, 0x054001A00C1004E0, 0x05B001900C600420, 0x055001100CC00440] T7 = [0xD00D6006E00EB00B, 0x100DB006D00EA00B, 0xF00D3006700EC00B, 0x900DC006F00E500B, 0xC00DD006300E100B, 0x000D0006000E000B, 0x200D5006900E700B, 0x600DF006800E900B, 0xE00D8006A00E600B, 0x800D7006200EF00B, 0x300DE006400ED00B, 0x700D4006500E300B, 0xA00D2006B00E800B, 0x400DA006100EE00B, 0xB00D9006600E200B, 0x500D1006C00E400B, 0xD001600BE00DB00A, 0x1001B00BD00DA00A, 0xF001300B700DC00A, 0x9001C00BF00D500A, 0xC001D00B300D100A, 0x0001000B000D000A, 0x2001500B900D700A, 0x6001F00B800D900A, 0xE001800BA00D600A, 0x8001700B200DF00A, 0x3001E00B400DD00A, 0x7001400B500D300A, 0xA001200BB00D800A, 0x4001A00B100DE00A, 0xB001900B600D200A, 0x5001100BC00D400A, 0xD00F6003E007B00C, 0x100FB003D007A00C, 0xF00F30037007C00C, 0x900FC003F007500C, 0xC00FD0033007100C, 0x000F00030007000C, 0x200F50039007700C, 0x600FF0038007900C, 0xE00F8003A007600C, 0x800F70032007F00C, 0x300FE0034007D00C, 0x700F40035007300C, 0xA00F2003B007800C, 0x400FA0031007E00C, 0xB00F90036007200C, 0x500F1003C007400C, 0xD009600CE00FB005, 0x1009B00CD00FA005, 0xF009300C700FC005, 0x9009C00CF00F5005, 0xC009D00C300F1005, 0x0009000C000F0005, 0x2009500C900F7005, 0x6009F00C800F9005, 0xE009800CA00F6005, 0x8009700C200FF005, 0x3009E00C400FD005, 0x7009400C500F3005, 0xA009200CB00F8005, 0x4009A00C100FE005, 0xB009900C600F2005, 0x5009100CC00F4005, 0xD00C600DE003B001, 0x100CB00DD003A001, 0xF00C300D7003C001, 0x900CC00DF0035001, 0xC00CD00D30031001, 0x000C000D00030001, 0x200C500D90037001, 0x600CF00D80039001, 0xE00C800DA0036001, 0x800C700D2003F001, 0x300CE00D4003D001, 0x700C400D50033001, 0xA00C200DB0038001, 0x400CA00D1003E001, 0xB00C900D60032001, 0x500C100DC0034001, 0xD0006000E000B000, 0x1000B000D000A000, 0xF00030007000C000, 0x9000C000F0005000, 0xC000D00030001000, 0x0000000000000000, 0x2000500090007000, 0x6000F00080009000, 0xE0008000A0006000, 0x800070002000F000, 0x3000E0004000D000, 0x7000400050003000, 0xA0002000B0008000, 0x4000A0001000E000, 0xB000900060002000, 0x50001000C0004000, 0xD0026005E009B007, 0x1002B005D009A007, 0xF00230057009C007, 0x9002C005F0095007, 0xC002D00530091007, 0x0002000500090007, 0x2002500590097007, 0x6002F00580099007, 0xE0028005A0096007, 0x800270052009F007, 0x3002E0054009D007, 0x7002400550093007, 0xA0022005B0098007, 0x4002A0051009E007, 0xB002900560092007, 0x50021005C0094007, 0xD006600FE008B009, 0x1006B00FD008A009, 0xF006300F7008C009, 0x9006C00FF0085009, 0xC006D00F30081009, 0x0006000F00080009, 0x2006500F90087009, 0x6006F00F80089009, 0xE006800FA0086009, 0x8006700F2008F009, 0x3006E00F4008D009, 0x7006400F50083009, 0xA006200FB0088009, 0x4006A00F1008E009, 0xB006900F60082009, 0x5006100FC0084009, 0xD00E6008E00AB006, 0x100EB008D00AA006, 0xF00E3008700AC006, 0x900EC008F00A5006, 0xC00ED008300A1006, 0x000E0008000A0006, 0x200E5008900A7006, 0x600EF008800A9006, 0xE00E8008A00A6006, 0x800E7008200AF006, 0x300EE008400AD006, 0x700E4008500A3006, 0xA00E2008B00A8006, 0x400EA008100AE006, 0xB00E9008600A2006, 0x500E1008C00A4006, 0xD0086007E002B00F, 0x1008B007D002A00F, 0xF00830077002C00F, 0x9008C007F002500F, 0xC008D0073002100F, 0x000800070002000F, 0x200850079002700F, 0x6008F0078002900F, 0xE0088007A002600F, 0x800870072002F00F, 0x3008E0074002D00F, 0x700840075002300F, 0xA0082007B002800F, 0x4008A0071002E00F, 0xB00890076002200F, 0x50081007C002400F, 0xD003600EE004B00D, 0x1003B00ED004A00D, 0xF003300E7004C00D, 0x9003C00EF004500D, 0xC003D00E3004100D, 0x0003000E0004000D, 0x2003500E9004700D, 0x6003F00E8004900D, 0xE003800EA004600D, 0x8003700E2004F00D, 0x3003E00E4004D00D, 0x7003400E5004300D, 0xA003200EB004800D, 0x4003A00E1004E00D, 0xB003900E6004200D, 0x5003100EC004400D, 0xD0076004E005B003, 0x1007B004D005A003, 0xF00730047005C003, 0x9007C004F0055003, 0xC007D00430051003, 0x0007000400050003, 0x2007500490057003, 0x6007F00480059003, 0xE0078004A0056003, 0x800770042005F003, 0x3007E0044005D003, 0x7007400450053003, 0xA0072004B0058003, 0x4007A0041005E003, 0xB007900460052003, 0x50071004C0054003, 0xD00A6002E00BB008, 0x100AB002D00BA008, 0xF00A3002700BC008, 0x900AC002F00B5008, 0xC00AD002300B1008, 0x000A0002000B0008, 0x200A5002900B7008, 0x600AF002800B9008, 0xE00A8002A00B6008, 0x800A7002200BF008, 0x300AE002400BD008, 0x700A4002500B3008, 0xA00A2002B00B8008, 0x400AA002100BE008, 0xB00A9002600B2008, 0x500A1002C00B4008, 0xD004600AE001B00E, 0x1004B00AD001A00E, 0xF004300A7001C00E, 0x9004C00AF001500E, 0xC004D00A3001100E, 0x0004000A0001000E, 0x2004500A9001700E, 0x6004F00A8001900E, 0xE004800AA001600E, 0x8004700A2001F00E, 0x3004E00A4001D00E, 0x7004400A5001300E, 0xA004200AB001800E, 0x4004A00A1001E00E, 0xB004900A6001200E, 0x5004100AC001400E, 0xD00B6009E006B002, 0x100BB009D006A002, 0xF00B30097006C002, 0x900BC009F0065002, 0xC00BD00930061002, 0x000B000900060002, 0x200B500990067002, 0x600BF00980069002, 0xE00B8009A0066002, 0x800B70092006F002, 0x300BE0094006D002, 0x700B400950063002, 0xA00B2009B0068002, 0x400BA0091006E002, 0xB00B900960062002, 0x500B1009C0064002, 0xD0056001E00CB004, 0x1005B001D00CA004, 0xF0053001700CC004, 0x9005C001F00C5004, 0xC005D001300C1004, 0x00050001000C0004, 0x20055001900C7004, 0x6005F001800C9004, 0xE0058001A00C6004, 0x80057001200CF004, 0x3005E001400CD004, 0x70054001500C3004, 0xA0052001B00C8004, 0x4005A001100CE004, 0xB0059001600C2004, 0x50051001C00C4004] RCandKeySizeConstLong = [0x0013000200140005, 0x0033000200340005, 0x0073000200740005, 0x0073001200740015, 0x0073003200740035, 0x0063007200640075, 0x0053007200540075, 0x0033007200340075, 0x0073006200740065, 0x0073005200740055, 0x0063003200640035, 0x0043007200440075, 0x0013007200140075, 0x0033006200340065, 0x0073004200740045, 0x0063001200640015, 0x0053003200540035, 0x0023007200240075, 0x0053006200540065, 0x0033005200340055, 0x0063002200640025, 0x0043005200440055, 0x0003003200040035, 0x0003006200040065, 0x0013004200140045, 0x0023000200240005, 0x0053000200540005, 0x0033001200340015, 0x0073002200740025, 0x0063005200640055, 0x0043003200440035, 0x0003007200040075, 0x0013006200140065, 0x0033004200340045, 0x0063000200640005, 0x0053001200540015, 0x0033003200340035, 0x0063006200640065, 0x0053005200540055, 0x0023003200240035, 0x0043006200440065, 0x0013005200140055, 0x0023002200240025, 0x0043004200440045, 0x0003001200040015, 0x0013002200140025, 0x0023004200240045, 0x0043000200440005] @classmethod def byte2ulong(cls, b, offSet): x = 0 for i in range(7, -1, -1): x = (x << 8) ^ b[i + offSet] return x @classmethod def ulong2byte(cls, x): b = [None] * 8 for i in range(0, 8, 1): b[i] = ((x >> i * 8) & 0xFF) return b @classmethod def ulong2byteCopy(cls, x, b, offSet): for i in range(0, 8, 1): b[offSet + i] = ((x >> i * 8) & 0xFF) return @classmethod def AddKey(cls, state, roundKey): return state ^ roundKey @classmethod def AddConstants(cls, state, round): return state ^ cls.RCandKeySizeConstLong[round] @classmethod def SubCellShiftRowAndMixColumns(cls, state): temp = cls.T0[state >> 0 & 0xFF] temp ^= cls.T1[state >> 8 & 0xFF] temp ^= cls.T2[state >> 16 & 0xFF] temp ^= cls.T3[state >> 24 & 0xFF] temp ^= cls.T4[state >> 32 & 0xFF] temp ^= cls.T5[state >> 40 & 0xFF] temp ^= cls.T6[state >> 48 & 0xFF] temp ^= cls.T7[state >> 56 & 0xFF] return temp @classmethod def Step(cls, state, step): for i in range(0, 4, 1): state = cls.AddConstants(state, (step * 4 + i)) state = cls.SubCellShiftRowAndMixColumns(state) return state @classmethod def EncryptOneBlock(cls, state, sk0, sk1): for i in range(0, 12, 2): state = cls.AddKey(state, sk0) state = cls.Step(state, i) state = cls.AddKey(state, sk1) state = cls.Step(state, i+1) state = cls.AddKey(state, sk0) return state @classmethod def Encrypt(cls, plainText, key): cipherText = [None] * len(plainText) sk0 = cls.byte2ulong(key, 0) sk2 = [None] * 8 for i in range(0, 8, 1): sk2[i] = key[(8 + i) % 10] sk1 = cls.byte2ulong(sk2, 0) for i in range(0, len(plainText), 8): state = cls.byte2ulong(plainText, i) state = cls.EncryptOneBlock(state, sk0, sk1) cls.ulong2byteCopy(state, cipherText, i) return cipherText
class Led_80_64: key_size = 64 t0 = [52636769843806293, 52355243327750231, 52918253410123867, 50947902803476570, 49822015781339218, 49540489264758864, 51510822692651102, 52073789825089617, 51229399255285852, 53762648275746909, 53199676846964825, 50384944260448342, 51792332028510291, 53481156119429215, 50103486463344724, 50666410646634584, 48132345586909301, 47850819070853239, 48413829153226875, 46443478546579578, 45317591524442226, 45036065007861872, 47006398435754110, 47569365568192625, 46724974998388860, 49258224018849917, 48695252590067833, 45880520003551350, 47287907771613299, 48976731862532223, 45599062206447732, 46161986389737592, 57140506904887477, 56858980388831415, 57421990471205051, 55451639864557754, 54325752842420402, 54044226325840048, 56014559753732286, 56577526886170801, 55733136316367036, 58266385336828093, 57703413908046009, 54888681321529526, 56296069089591475, 57984893180510399, 54607223524425908, 55170147707715768, 25614897198530725, 25333370682474663, 25896380764848299, 23926030158201002, 22800143136063650, 22518616619483296, 24488950047375534, 25051917179814049, 24207526610010284, 26740775630471341, 26177804201689257, 23363071615172774, 24770459383234723, 26459283474153647, 23081613818069156, 23644538001359016, 7600704844333093, 7319178328277031, 7882188410650667, 5911837804003370, 4785950781866018, 4504424265285664, 6474757693177902, 7037724825616417, 6193334255812652, 8726583276273709, 8163611847491625, 5348879260975142, 6756267029037091, 8445091119956015, 5067421463871524, 5630345647161384, 3096280579047429, 2814754062991367, 3377764145365003, 1407413538717706, 281526516580354, 0, 1970333427892238, 2533300560330753, 1688909990526988, 4222159010988045, 3659187582205961, 844454995689478, 2251842763751427, 3940666854670351, 562997198585860, 1125921381875720, 34621615425323237, 34340088909267175, 34903098991640811, 32932748384993514, 31806861362856162, 31525334846275808, 33495668274168046, 34058635406606561, 33214244836802796, 35747493857263853, 35184522428481769, 32369789841965286, 33777177610027235, 35466001700946159, 32088332044861668, 32651256228151528, 43629089544339477, 43347563028283415, 43910573110657051, 41940222504009754, 40814335481872402, 40532808965292048, 42503142393184286, 43066109525622801, 42221718955819036, 44754967976280093, 44191996547498009, 41377263960981526, 42784651729043475, 44473475819962399, 41095806163877908, 41658730347167768, 30118840427479237, 29837313911423175, 30400323993796811, 28429973387149514, 27304086365012162, 27022559848431808, 28992893276324046, 29555860408762561, 28711469838958796, 31244718859419853, 30681747430637769, 27867014844121286, 29274402612183235, 30963226703102159, 27585557047017668, 28148481230307528, 70650824754856149, 70369298238800087, 70932308321173723, 68961957714526426, 67836070692389074, 67554544175808720, 69524877603700958, 70087844736139473, 69243454166335708, 71776703186796765, 71213731758014681, 68398999171498198, 69806386939560147, 71495211030479071, 68117541374394580, 68680465557684440, 61643281894342805, 61361755378286743, 61924765460660379, 59954414854013082, 58828527831875730, 58547001315295376, 60517334743187614, 61080301875626129, 60235911305822364, 62769160326283421, 62206188897501337, 59391456310984854, 60798844079046803, 62487668169965727, 59109998513881236, 59672922697171096, 16607560510079077, 16326033994023015, 16889044076396651, 14918693469749354, 13792806447612002, 13511279931031648, 15481613358923886, 16044580491362401, 15200189921558636, 17733438942019693, 17170467513237609, 14355734926721126, 15763122694783075, 17451946785701999, 14074277129617508, 14637201312907368, 39125764799070261, 38844238283014199, 39407248365387835, 37436897758740538, 36311010736603186, 36029484220022832, 37999817647915070, 38562784780353585, 37718394210549820, 40251643231010877, 39688671802228793, 36873939215712310, 38281326983774259, 39970151074693183, 36592481418608692, 37155405601898552, 66146950253773045, 65865423737716983, 66428433820090619, 64458083213443322, 63332196191305970, 63050669674725616, 65021003102617854, 65583970235056369, 64739579665252604, 67272828685713661, 66709857256931577, 63895124670415094, 65302512438477043, 66991336529395967, 63613666873311476, 64176591056601336, 12104235756421189, 11822709240365127, 12385719322738763, 10415368716091466, 9289481693954114, 9007955177373760, 10978288605265998, 11541255737704513, 10696865167900748, 13230114188361805, 12667142759579721, 9852410173063238, 11259797941125187, 12948622032044111, 9570952375959620, 10133876559249480, 21111022689058949, 20829496173002887, 21392506255376523, 19422155648729226, 18296268626591874, 18014742110011520, 19985075537903758, 20548042670342273, 19703652100538508, 22236901120999565, 21673929692217481, 18859197105700998, 20266584873762947, 21955408964681871, 18577739308597380, 19140663491887240] t1 = [13475013080014411008, 13402942291904059136, 13547072872991709952, 13042663117690001920, 12754436040022839808, 12682365251778269184, 13186770609318682112, 13330890195222941952, 13114726209353178112, 13763237958591208704, 13619117272822995200, 12898545730674775552, 13258836999298634496, 13691175966573879040, 12826492534616249344, 12970601125538453504, 12321880470248781056, 12249809682138429184, 12393940263226080000, 11889530507924371968, 11601303430257209856, 11529232642012639232, 12033637999553052160, 12177757585457312000, 11961593599587548160, 12610105348825578752, 12465984663057365248, 11745413120909145600, 12105704389533004544, 12538043356808249088, 11673359924850619392, 11817468515772823552, 14627969767651194112, 14555898979540842240, 14700029560628493056, 14195619805326785024, 13907392727659622912, 13835321939415052288, 14339727296955465216, 14483846882859725056, 14267682896989961216, 14916194646227991808, 14772073960459778304, 14051502418311558656, 14411793686935417600, 14844132654210662144, 13979449222253032448, 14123557813175236608, 6557413682823865600, 6485342894713513728, 6629473475801164544, 6125063720499456512, 5836836642832294400, 5764765854587723776, 6269171212128136704, 6413290798032396544, 6197126812162632704, 6845638561400663296, 6701517875632449792, 5980946333484230144, 6341237602108089088, 6773576569383333632, 5908893137425703936, 6053001728347908096, 1945780440149271808, 1873709652038919936, 2017840233126570752, 1513430477824862720, 1225203400157700608, 1153132611913129984, 1657537969453542912, 1801657555357802752, 1585493569488038912, 2234005318726069504, 2089884632957856000, 1369313090809636352, 1729604359433495296, 2161943326708739840, 1297259894751110144, 1441368485673314304, 792647828236141824, 720577040125789952, 864707621213440768, 360297865911732736, 72070788244570624, 0, 504405357540412928, 648524943444672768, 432360957574908928, 1080872706812939520, 936752021044726016, 216180478896506368, 576471747520365312, 1008810714795609856, 144127282837980160, 288235873760184320, 8863133548882748672, 8791062760772396800, 8935193341860047616, 8430783586558339584, 8142556508891177472, 8070485720646606848, 8574891078187019776, 8719010664091279616, 8502846678221515776, 9151358427459546368, 9007237741691332864, 8286666199543113216, 8646957468166972160, 9079296435442216704, 8214613003484587008, 8358721594406791168, 11169046923350906112, 11096976135240554240, 11241106716328205056, 10736696961026497024, 10448469883359334912, 10376399095114764288, 10880804452655177216, 11024924038559437056, 10808760052689673216, 11457271801927703808, 11313151116159490304, 10592579574011270656, 10952870842635129600, 11385209809910374144, 10520526377952744448, 10664634968874948608, 7710423149434684672, 7638352361324332800, 7782482942411983616, 7278073187110275584, 6989846109443113472, 6917775321198542848, 7422180678738955776, 7566300264643215616, 7350136278773451776, 7998648028011482368, 7854527342243268864, 7133955800095049216, 7494247068718908160, 7926586035994152704, 7061902604036523008, 7206011194958727168, 18086611137243174144, 18014540349132822272, 18158670930220473088, 17654261174918765056, 17366034097251602944, 17293963309007032320, 17798368666547445248, 17942488252451705088, 17726324266581941248, 18374836015819971840, 18230715330051758336, 17510143787903538688, 17870435056527397632, 18302774023802642176, 17438090591845012480, 17582199182767216640, 15780680164951758080, 15708609376841406208, 15852739957929057024, 15348330202627348992, 15060103124960186880, 14988032336715616256, 15492437694256029184, 15636557280160289024, 15420393294290525184, 16068905043528555776, 15924784357760342272, 15204212815612122624, 15564504084235981568, 15996843051511226112, 15132159619553596416, 15276268210475800576, 4251535490580243712, 4179464702469891840, 4323595283557542656, 3819185528255834624, 3530958450588672512, 3458887662344101888, 3963293019884514816, 4107412605788774656, 3891248619919010816, 4539760369157041408, 4395639683388827904, 3675068141240608256, 4035359409864467200, 4467698377139711744, 3603014945182082048, 3747123536104286208, 10016195788561986816, 9944125000451634944, 10088255581539285760, 9583845826237577728, 9295618748570415616, 9223547960325844992, 9727953317866257920, 9872072903770517760, 9655908917900753920, 10304420667138784512, 10160299981370571008, 9439728439222351360, 9800019707846210304, 10232358675121454848, 9367675243163825152, 9511783834086029312, 16933619264965899520, 16861548476855547648, 17005679057943198464, 16501269302641490432, 16213042224974328320, 16140971436729757696, 16645376794270170624, 16789496380174430464, 16573332394304666624, 17221844143542697216, 17077723457774483712, 16357151915626264064, 16717443184250123008, 17149782151525367552, 16285098719567737856, 16429207310489942016, 3098684353643824384, 3026613565533472512, 3170744146621123328, 2666334391319415296, 2378107313652253184, 2306036525407682560, 2810441882948095488, 2954561468852355328, 2738397482982591488, 3386909232220622080, 3242788546452408576, 2522217004304188928, 2882508272928047872, 3314847240203292416, 2450163808245662720, 2594272399167866880, 5404421808399090944, 5332351020288739072, 5476481601376389888, 4972071846074681856, 4683844768407519744, 4611773980162949120, 5116179337703362048, 5260298923607621888, 5044134937737858048, 5692646686975888640, 5548526001207675136, 4827954459059455488, 5188245727683314432, 5620584694958558976, 4755901263000929280, 4900009853923133440] t2 = [12685303165102243852, 11532364068040888332, 13838189483457929228, 5767844506473771020, 1156140892639105036, 3096241924603916, 8073652329704759308, 10379565707394207756, 6920642864436097036, 17297112325610725388, 14991163763817639948, 3462019086761754636, 9226696980150763532, 16144208412921458700, 2309185543353536524, 4615046146363891724, 12685021685830500357, 11532082588769144837, 13837908004186185733, 5767563027202027525, 1155859413367361541, 2814762652860421, 8073370850433015813, 10379284228122464261, 6920361385164353541, 17296830846338981893, 14990882284545896453, 3461737607490011141, 9226415500879020037, 16143926933649715205, 2308904064081793029, 4614764667092148229, 12685584631488561158, 11532645534427205638, 13838470949844246534, 5768125972860088326, 1156422359025422342, 3377708310921222, 8073933796091076614, 10379847173780525062, 6920924330822414342, 17297393791997042694, 14991445230203957254, 3462300553148071942, 9226978446537080838, 16144489879307776006, 2309467009739853830, 4615327612750209030, 12683614332421914635, 11530675235360559115, 13836500650777600011, 5766155673793441803, 1154452059958775819, 1407409244274699, 8071963497024430091, 10377876874713878539, 6918954031755767819, 17295423492930396171, 14989474931137310731, 3460330254081425419, 9225008147470434315, 16142519580241129483, 2307496710673207307, 4613357313683562507, 12682488428219318281, 11529549331157962761, 13835374746575003657, 5765029769590845449, 1153326155756179465, 281505041678345, 8070837592821833737, 10376750970511282185, 6917828127553171465, 17294297588727799817, 14988349026934714377, 3459204349878829065, 9223882243267837961, 16141393676038533129, 2306370806470610953, 4612231409480966153, 12682206923177639936, 11529267826116284416, 13835093241533325312, 5764748264549167104, 1153044650714501120, 0, 8070556087780155392, 10376469465469603840, 6917546622511493120, 17294016083686121472, 14988067521893036032, 3458922844837150720, 9223600738226159616, 16141112170996854784, 2306089301428932608, 4611949904439287808, 12684177273785008138, 11531238176723652618, 13837063592140693514, 5766718615156535306, 1155015001321869322, 1970350607368202, 8072526438387523594, 10378439816076972042, 6919516973118861322, 17295986434293489674, 14990037872500404234, 3460893195444518922, 9225571088833527818, 16143082521604222986, 2308059652036300810, 4613920255046656010, 12684740240918233101, 11531801143856877581, 13837626559273918477, 5767281582289760269, 1155577968455094285, 2533317740593165, 8073089405520748557, 10379002783210197005, 6920079940252086285, 17296549401426714637, 14990600839633629197, 3461456162577743885, 9226134055966752781, 16143645488737447949, 2308622619169525773, 4614483222179880973, 12683895777333526531, 11530956680272171011, 13836782095689211907, 5766437118705053699, 1154733504870387715, 1688854155886595, 8072244941936041987, 10378158319625490435, 6919235476667379715, 17295704937842008067, 14989756376048922627, 3460611698993037315, 9225289592382046211, 16142801025152741379, 2307778155584819203, 4613638758595174403, 12686429095073071118, 11533489998011715598, 13839315413428756494, 5768970436444598286, 1157266822609932302, 4222171895431182, 8074778259675586574, 10380691637365035022, 6921768794406924302, 17298238255581552654, 14992289693788467214, 3463145016732581902, 9227822910121590798, 16145334342892285966, 2310311473324363790, 4616172076334718990, 12685866119349977103, 11532927022288621583, 13838752437705662479, 5768407460721504271, 1156703846886838287, 3659196172337167, 8074215283952492559, 10380128661641941007, 6921205818683830287, 17297675279858458639, 14991726718065373199, 3462582041009487887, 9227259934398496783, 16144771367169191951, 2309748497601269775, 4615609100611624975, 12683051386762805256, 11530112289701449736, 13835937705118490632, 5765592728134332424, 1153889114299666440, 844463585165320, 8071400551365320712, 10377313929054769160, 6918391086096658440, 17294860547271286792, 14988911985478201352, 3459767308422316040, 9224445201811324936, 16141956634582020104, 2306933765014097928, 4612794368024453128, 12684458778826620932, 11531519681765265412, 13837345097182306308, 5767000120198148100, 1155296506363482116, 2251855648980996, 8072807943429136388, 10378721321118584836, 6919798478160474116, 17296267939335102468, 14990319377542017028, 3461174700486131716, 9225852593875140612, 16143364026645835780, 2308341157077913604, 4614201760088268804, 12686147624391262215, 11533208527329906695, 13839033942746947591, 5768688965762789383, 1156985351928123399, 3940701213622279, 8074496788993777671, 10380410166683226119, 6921487323725115399, 17297956784899743751, 14992008223106658311, 3462863546050772999, 9227541439439781895, 16145052872210477063, 2310030002642554887, 4615890605652910087, 12682769933260996609, 11529830836199641089, 13835656251616681985, 5765311274632523777, 1153607660797857793, 563010083356673, 8071119097863512065, 10377032475552960513, 6918109632594849793, 17294579093769478145, 14988630531976392705, 3459485854920507393, 9224163748309516289, 16141675181080211457, 2306652311512289281, 4612512914522644481, 12683332887509778434, 11530393790448422914, 13836219205865463810, 5765874228881305602, 1154170615046639618, 1125964332138498, 8071682052112293890, 10377595429801742338, 6918672586843631618, 17295142048018259970, 14989193486225174530, 3460048809169289218, 9224726702558298114, 16142238135328993282, 2307215265761071106, 4613075868771426306] t3 = [842177803492265152, 837674135144369232, 846681265673342048, 815156480606997680, 797142013365456016, 792637932698602496, 824163542416493728, 833171016548093136, 819659599192788016, 860192683025501408, 851185071455997168, 806149350061247616, 828667623082298432, 855689152116558960, 801646094032309264, 810653362012818464, 770119109925930432, 765615441578034512, 774622572107007328, 743097787040662960, 725083319799121296, 720579239132267776, 752104848850159008, 761112322981758416, 747600905626453296, 788133989459166688, 779126377889662448, 734090656494912896, 756608929515963712, 783630458550224240, 729587400465974544, 738594668446483744, 914233198389495488, 909729530041599568, 918736660570572384, 887211875504228016, 869197408262686352, 864693327595832832, 896218937313724064, 905226411445323472, 891714994090018352, 932248077922731744, 923240466353227504, 878204744958477952, 900723017979528768, 927744547013789296, 873701488929539600, 882708756910048800, 409836637327985600, 405332968980089680, 414340099509062496, 382815314442718128, 364800847201176464, 360296766534322944, 391822376252214176, 400829850383813584, 387318433028508464, 427851516861221856, 418843905291717616, 373808183896968064, 396326456918018880, 423347985952279408, 369304927868029712, 378312195848538912, 121605161463318976, 117101493115423056, 126108623644395872, 94583838578051504, 76569371336509840, 72065290669656320, 103590900387547552, 112598374519146960, 99086957163841840, 139620040996555232, 130612429427050992, 85576708032301440, 108094981053352256, 135116510087612784, 81073452003363088, 90080719983872288, 49539870793662656, 45036202445766736, 54043332974739552, 22518547908395184, 4504080666853520, 0, 31525609717891232, 40533083849490640, 27021666494185520, 67554750326898912, 58547138757394672, 13511417362645120, 36029690383695936, 63051219417956464, 9008161333706768, 18015429314215968, 553949626279922368, 549445957932026448, 558453088460999264, 526928303394654896, 508913836153113232, 504409755486259712, 535935365204150944, 544942839335750352, 531431421980445232, 571964505813158624, 562956894243654384, 517921172848904832, 540439445869955648, 567460974904216176, 513417916819966480, 522425184800475680, 698069212385512896, 693565544037616976, 702572674566589792, 671047889500245424, 653033422258703760, 648529341591850240, 680054951309741472, 689062425441340880, 675551008086035760, 716084091918749152, 707076480349244912, 662040758954495360, 684559031975546176, 711580561009806704, 657537502925557008, 666544770906066208, 481886534700630976, 477382866352735056, 486389996881707872, 454865211815363504, 436850744573821840, 432346663906968320, 463872273624859552, 472879747756458960, 459368330401153840, 499901414233867232, 490893802664362992, 445858081269613440, 468376354290664256, 495397883324924784, 441354825240675088, 450362093221184288, 1130415876024045248, 1125912207676149328, 1134919338205122144, 1103394553138777776, 1085380085897236112, 1080876005230382592, 1112401614948273824, 1121409089079873232, 1107897671724568112, 1148430755557281504, 1139423143987777264, 1094387422593027712, 1116905695614078528, 1143927224648339056, 1089884166564089360, 1098891434544598560, 986294090911977408, 981790422564081488, 990797553093054304, 959272768026709936, 941258300785168272, 936754220118314752, 968279829836205984, 977287303967805392, 963775886612500272, 1004308970445213664, 995301358875709424, 950265637480959872, 972783910502010688, 999805439536271216, 945762381452021520, 954769649432530720, 265722548595984576, 261218880248088656, 270226010777061472, 238701225710717104, 220686758469175440, 216182677802321920, 247708287520213152, 256715761651812560, 243204344296507440, 283737428129220832, 274729816559716592, 229694095164967040, 252212368186017856, 279233897220278384, 225190839136028688, 234198107116537888, 626014916932797632, 621511248584901712, 630518379113874528, 598993594047530160, 580979126805988496, 576475046139134976, 608000655857026208, 617008129988625616, 603496712633320496, 644029796466033888, 635022184896529648, 589986463501780096, 612504736522830912, 639526265557091440, 585483207472841744, 594490475453350944, 1058359381480966080, 1053855713133070160, 1062862843662042976, 1031338058595698608, 1013323591354156944, 1008819510687303424, 1040345120405194656, 1049352594536794064, 1035841177181488944, 1076374261014202336, 1067366649444698096, 1022330928049948544, 1044849201070999360, 1071870730105259888, 1017827672021010192, 1026834940001519392, 193670452132970944, 189166783785075024, 198173914314047840, 166649129247703472, 148634662006161808, 144130581339308288, 175656191057199520, 184663665188798928, 171152247833493808, 211685331666207200, 202677720096702960, 157641998701953408, 180160271723004224, 207181800757264752, 153138742673015056, 162146010653524256, 337786739821118144, 333283071473222224, 342290202002195040, 310765416935850672, 292750949694309008, 288246869027455488, 319772478745346720, 328779952876946128, 315268535521641008, 355801619354354400, 346794007784850160, 301758286390100608, 324276559411151424, 351298088445411952, 297255030361162256, 306262298341671456] t4 = [9799851483422833408, 9655739593764420096, 9511629903431252992, 9439564612610602240, 10232201445730464000, 9223389631456784384, 10088089556072052480, 9727804884551514368, 9367519113435461120, 9583684198766526208, 9943978766076263680, 9295463718404010752, 9871923371078367232, 10016026464543096320, 10304264537225867776, 10160146050699015168, 7494061248888220416, 7349949359229807104, 7205839668896640000, 7133774378075989248, 7926411211195851008, 6917599396922171392, 7782299321537439488, 7422014650016901376, 7061728878900848128, 7277893964231913216, 7638188531541650688, 6989673483869397760, 7566133136543754240, 7710236230008483328, 7998474302691254784, 7854355816164402176, 5188306203557546752, 5044194313899133440, 4900084623565966336, 4828019332745315584, 5620656165865177344, 4611844351591497728, 5476544276206765824, 5116259604686227712, 4755973833570174464, 4972138918901239552, 5332433486210977024, 4683918438538724096, 5260378091213080576, 5404481184677809664, 5692719257360581120, 5548600770833728512, 4035261550427134720, 3891149660768721408, 3747039970435554304, 3674974679614903552, 4467611512734765312, 3458799698461085696, 4323499623076353792, 3963214951555815680, 3602929180439762432, 3819094265770827520, 4179388833080564992, 3530873785408312064, 4107333438082668544, 4251436531547397632, 4539674604230169088, 4395556117703316480, 16717450880344922880, 16573338990686509568, 16429229300353342464, 16357164009532691712, 17149800842652553472, 16140989028378873856, 17005688952994141952, 16645404281473603840, 16285118510357550592, 16501283595688615680, 16861578162998353152, 16213063115326100224, 16789522768000456704, 16933625861465185792, 17221863934147957248, 17077745447621104640, 576461851966049024, 432349962307635712, 288240271974468608, 216174981153817856, 1008811814273679616, 0, 864699924615268096, 504415253094729984, 144129481978676736, 360294567309741824, 720589134619479296, 72074086947226368, 648533739621582848, 792636833086311936, 1080874905769083392, 936756419242230784, 14411660645810338560, 14267548756151925248, 14123439065818758144, 14051373774998107392, 14844010608117969152, 13835198793844289536, 14699898718459557632, 14339614046939019520, 13979328275822966272, 14195493361154031360, 14555787928463768832, 13907272880791515904, 14483732533465872384, 14627835626930601472, 14916073699613372928, 14771955213086520320, 8647105901481728768, 8502994011823315456, 8358884321490148352, 8286819030669497600, 9079455863789359360, 8070644049515679744, 8935343974130947840, 8575059302610409728, 8214773531494356480, 8430938616825421568, 8791233184135159040, 8142718136462906112, 8719177789137262592, 8863280882601991680, 9151518955284763136, 9007400468757910528, 2882533563624876800, 2738421673966463488, 2594311983633296384, 2522246692812645632, 3314883525932507392, 2306071711658827776, 3170771636274095872, 2810486964753557760, 2450201193637504512, 2666366278968569600, 3026660846278307072, 2378145798606054144, 2954605451280410624, 3098708544745139712, 3386946617427911168, 3242828130901058560, 6341174928921918208, 6197063039263504896, 6052953348930337792, 5980888058109687040, 6773524891229548800, 5764713076955869184, 6629413001571137280, 6269128330050599168, 5908842558934545920, 6125007644265611008, 6485302211575348480, 5836787163903095552, 6413246816577452032, 6557349910042181120, 6845587982724952576, 6701469496198099968, 12105888005877717760, 11961776116219304448, 11817666425886137344, 11745601135065486592, 12538237968185348352, 11529426153911668736, 12394126078526936832, 12033841407006398720, 11673555635890345472, 11889720721221410560, 12250015288531148032, 11601500240858895104, 12177959893533251584, 12322062986997980672, 12610301059680752128, 12466182573153899520, 1729647243121670912, 1585535353463257600, 1441425663130090496, 1369360372309439744, 2161997205429301504, 1153185391155621888, 2017885315770889984, 1657600644250351872, 1297314873134298624, 1513479958465363712, 1873774525775101184, 1225259478102848256, 1801719130777204736, 1945822224241933824, 2234060296924705280, 2089941810397852672, 10953001685911374592, 10808889796252961280, 10664780105919794176, 10592714815099143424, 11385351648219005184, 10376539833945325568, 11241239758560593664, 10880955087040055552, 10520669315924002304, 10736834401255067392, 11097128968564804864, 10448613920892551936, 11025073573566908416, 11169176667031637504, 11457414739714408960, 11313296253187556352, 13258651181347040000, 13114539291688626688, 12970429601355459584, 12898364310534808832, 13691001143654670592, 12682189329380990976, 13546889253996259072, 13186604582475720960, 12826318811359667712, 13042483896690732800, 13402778464000470272, 12754263416328217344, 13330723069002573824, 13474826162467302912, 13763064235150074368, 13618945748623221760, 17870460344271383296, 17726348454612969984, 17582238764279802880, 17510173473459152128, 18302810306579013888, 17293998492305334272, 18158698416920602368, 17798413745400064256, 17438127974284011008, 17654293059615076096, 18014587626924813568, 17366072579252560640, 17942532231926917120, 18086635325391646208, 18374873398074417664, 18230754911547565056, 15564564559841741568, 15420452670183328256, 15276342979850161152, 15204277689029510400, 15996914522149372160, 14988102707875692544, 15852802632490960640, 15492517960970422528, 15132232189854369280, 15348397275185434368, 15708691842495171840, 15060176794822918912, 15636636447497275392, 15780739540962004480, 16068977613644775936, 15924859127117923328] t5 = [38280669857120443, 37717732788142266, 37154804310278332, 36873299268010165, 39969536897384625, 36028865747878064, 39406599828406455, 37999237830279353, 36591871536857270, 37436266401431743, 38843667054985405, 36310405150015667, 38562200668274872, 39125103377121470, 40251033348538546, 39688070510543028, 29273676753469611, 28710739684491434, 28147811206627500, 27866306164359333, 30962543793733793, 27021872644227232, 30399606724755623, 28992244726628521, 27584878433206438, 28429273297780911, 29836673951334573, 27303412046364835, 29555207564624040, 30118110273470638, 31244040244887714, 30681077406892196, 20266821107646667, 19703884038668490, 19140955560804556, 18859450518536389, 21955688147910849, 18015016998404288, 21392751078932679, 19985389080805577, 18578022787383494, 19422417651957967, 20829818305511629, 18296556400541891, 20548351918801096, 21111254627647694, 22237184599064770, 21674221761069252, 15762740431355995, 15199803362377818, 14636874884513884, 14355369842245717, 17451607471620177, 13510936322113616, 16888670402642007, 15481308404514905, 14073942111092822, 14918336975667295, 16325737629220957, 13792475724251219, 16044271242510424, 16607173951357022, 17733103922774098, 17170141084778580, 65302542501347355, 64739605432369178, 64176676954505244, 63895171912237077, 66991409541611537, 63050738392104976, 66428472472633367, 65021110474506265, 63613744181084182, 64458139045658655, 65865539699212317, 63332277794242579, 65584073312501784, 66146976021348382, 67272905992765458, 66709943154769940, 2251804109242379, 1688867040264202, 1125938562400268, 844433520132101, 3940671149506561, 0, 3377734080528391, 1970372082401289, 563005788979206, 1407400653553679, 2814801307107341, 281539402137603, 2533334920396808, 3096237629243406, 4222167600660482, 3659204762664964, 56295549397696635, 55732612328718458, 55169683850854524, 54888178808586357, 57984416437960817, 54043745288454256, 57421479368982647, 56014117370855545, 54606751077433462, 55451145942007935, 56858546595561597, 54325284690591859, 56577080208851064, 57139982917697662, 58265912889114738, 57702950051119220, 33777757427663003, 33214820358684826, 32651891880820892, 32370386838552725, 35466624467927185, 31525953318420624, 34903687398949015, 33496325400821913, 32088959107399830, 32933353971974303, 34340754625527965, 31807492720558227, 34059288238817432, 34622190947664030, 35748120919081106, 35185158081085588, 11259896732909675, 10696959663931498, 10134031186067564, 9852526143799397, 12948763773173857, 9008092623667296, 12385826704195687, 10978464706068585, 9571098412646502, 10415493277220975, 11822893930774637, 9289632025804899, 11541427544064104, 12104330252910702, 13230260224327778, 12667297386332260, 24770214566101243, 24207277497123066, 23644349019259132, 23362843976990965, 26459081606365425, 22518410456858864, 25896144537387255, 24488782539260153, 23081416245838070, 23925811110412543, 25333211763966205, 22799949858996467, 25051745377255672, 25614648086102270, 26740578057519346, 26177615219523828, 47288625022959835, 46725687953981658, 46162759476117724, 45881254433849557, 48977492063224017, 45036820913717456, 48414554994245847, 47007192996118745, 45599826702696662, 46444221567271135, 47851622220824797, 45318360315855059, 47570155834114264, 48133058542960862, 49258988514377938, 48696025676382420, 6756434543444027, 6193497474465850, 5630568996601916, 5349063954333749, 8445301583708209, 4504630434201648, 7882364514730039, 6475002516602937, 5067636223180854, 5912031087755327, 7319431741308989, 4786169836339251, 7037965354598456, 7600868063445054, 8726798034862130, 8163835196866612, 42785162835591307, 42222225766613130, 41659297288749196, 41377792246481029, 44474029875855489, 40533358726348928, 43911092806877319, 42503730808750217, 41096364515328134, 41940759379902607, 43348160033456269, 40814898128486531, 43066693646745736, 43629596355592334, 44755526327009410, 44192563489013892, 51791606177136875, 51228669108158698, 50665740630294764, 50384235588026597, 53480473217401057, 49539802067894496, 52917536148422887, 51510174150295785, 50102807856873702, 50947202721448175, 52354603375001837, 49821341470032099, 52073136988291304, 52636039697137902, 53761969668554978, 53199006830559460, 69806485719810091, 69243548650831914, 68680620172967980, 68399115130699813, 71495352760074273, 67554681610567712, 70932415691096103, 69525053692969001, 68117687399546918, 68962082264121391, 70369482917675053, 67836221012705315, 70088016530964520, 70650919239811118, 71776849211228194, 71213886373232676, 60799080311881803, 60236143242903626, 59673214765039692, 59391709722771525, 62487947352145985, 58547276202639424, 61925010283167815, 60517648285040713, 59110281991618630, 59954676856193103, 61362077509746765, 58828815604777027, 61080611123036232, 61643513831882830, 62769443803299906, 62206480965304388] t6 = [995302527285070768, 941259675352959904, 1004309520374041536, 977288541093497680, 990799408682502928, 936755319797713664, 945762862659275632, 963777948362476432, 999806264347200352, 972784597855112176, 950267080756693968, 968280792072457008, 981791453521906560, 954770405503011808, 986295534180371232, 959273386666625856, 130616896371296944, 76574044439186080, 139623889460267712, 112602910179723856, 126113777768729104, 72069688883939840, 81077231745501808, 99092317448702608, 135120633433426528, 108098966941338352, 85581449842920144, 103595161158683184, 117105822608132736, 90084774589237984, 121609903266597408, 94587755752852032, 1139414416708603056, 1085371564776492192, 1148421409797573824, 1121400430517029968, 1134911298106035216, 1080867209221245952, 1089874752082807920, 1107889837786008720, 1143918153770732640, 1116896487278644464, 1094378970180226256, 1112392681495989296, 1125903342945438848, 1098882294926544096, 1130407423603903520, 1103385276090158144, 707078748219901360, 653035896287790496, 716085741308872128, 689064762028328272, 702575629617333520, 648531540732544256, 657539083594106224, 675554169297307024, 711582485282030944, 684560818789942768, 662043301691524560, 680057013007287600, 693567674456737152, 666546626437842400, 698071755115201824, 671049607601456448, 923252629643985328, 869209777711874464, 932259622732956096, 905238643452412240, 918749511041417488, 864705422156628224, 873712965018190192, 891728050721390992, 927756366706114912, 900734700214026736, 878217183115608528, 896230894431371568, 909741555880821120, 882720507861926368, 914245636539285792, 887223489025540416, 58547207487357104, 4504355555246240, 67554200576327872, 40533221295784016, 54044088884789264, 0, 9007542861561968, 27022628564762768, 63050944549486688, 36029278057398512, 13511760958980304, 31525472274743344, 45036133724192896, 18015085705298144, 49540214382657568, 22518066868912192, 202667893272348592, 148625041340237728, 211674886361319360, 184653907080775504, 198164774669780752, 144120685784991488, 153128228646553456, 171143314349754256, 207171630334478176, 180149963842390000, 157632446743971792, 175646158059734832, 189156819509184384, 162135771490289632, 193660900167649056, 166638752653903680, 490909264523561392, 436866412591450528, 499916257612532160, 472895278331988304, 486406145920993552, 432362057036204288, 441369599897766256, 459384685600967056, 495413001585690976, 468391335093602800, 445873817995184592, 463887529310947632, 477398190760397184, 450377142741502432, 481902271418861856, 454880123905116480, 1067362320279144112, 1013319468347033248, 1076369313368114880, 1049348334087571024, 1062859201676576272, 1008815112791787008, 1017822655653348976, 1035837741356549776, 1071866057341273696, 1044844390849185520, 1022326873750767312, 1040340585066530352, 1053851246515979904, 1026830198497085152, 1058355327174444576, 1031333179660699200, 635015656405733296, 580972804473622432, 644022649494704064, 617001670214160208, 630512537803165456, 576468448918376192, 585475991779938160, 603491077483138960, 639519393467862880, 612497726975774704, 589980209877356496, 607993921193119536, 621504582642569088, 594483534623674336, 626008663301033760, 598986515787288384, 274735382831041968, 220692530898931104, 283742375920012736, 256721396639468880, 270232264228474128, 216188175343684864, 225195718205246832, 243210803908447632, 279239119893171552, 252217453401083376, 229699936302665168, 247713647618428208, 261224309067877760, 234203261048983008, 265728389726342432, 238706242212597056, 562954763883250608, 508911911951139744, 571961756972221376, 544940777691677520, 558451645280682768, 504407556395893504, 513415099257455472, 531430184960656272, 567458500945380192, 540436834453292016, 517919317354873808, 535933028670636848, 549443690120086400, 522422642101191648, 553947770778551072, 526925623264805696, 779125347074443440, 725082495142332576, 788132340163414208, 761111360882870352, 774622228471875600, 720578139587086336, 729585682448648304, 747600768151849104, 783629084136573024, 756607417644484848, 734089900546066640, 752103611861829680, 765614273311279232, 738593225292384480, 770118353969743904, 743096206455998528, 346788578772127408, 292745726840016544, 355795571861098176, 328774592580554320, 342285460169559568, 288241371284770304, 297248914146332272, 315263999849533072, 351292315834256992, 324270649342168816, 301753132243750608, 319766843559513648, 333277505008963200, 306256456990068448, 337781585667427872, 310759438153682496, 851190637609878192, 797147785677767328, 860197630698848960, 833176651418305104, 846687519007310352, 792643430122521088, 801650972984083056, 819666058687283856, 855694374672007776, 828672708179919600, 806155191081501392, 824168902397264432, 837679563846713984, 810658515827819232, 842183644505178656, 815161496991433280, 418836277389952176, 364793425457841312, 427843270478922944, 400822291198379088, 414333158787384336, 360289069902595072, 369296612764157040, 387311698467357840, 423340014452081760, 396318347959993584, 373800830861575376, 391814542177338416, 405325203626787968, 378304155607893216, 409829284285252640, 382807136771507264] t7 = [14991744317231378443, 1156774222610997259, 17297534548007895051, 10380163852188667915, 13838945954974011403, 3659200467959819, 2309590173027823627, 6921452113047228427, 16144701005136551947, 9227154383161978891, 3462670005966917643, 8074180102802255883, 11532909433861341195, 4615521141024284683, 12685954082428297227, 5768284318909480971, 14988366638985621514, 1153396544365240330, 17294156869762138122, 10376786173942910986, 13835568276728254474, 281522222202890, 2306212494782066698, 6918074434801471498, 16141323326890795018, 9223776704916221962, 3459292327721160714, 8070802424556498954, 11529531755615584266, 4612143462778527754, 12682576404182540298, 5764906640663724042, 14992307254299439116, 1157337159679057932, 17298097485075955724, 10380726789256728588, 13839508892042072076, 4222137536020492, 2310153110095884300, 6922015050115289100, 16145263942204612620, 9227717320230039564, 3463232943034978316, 8074743039870316556, 11533472370929401868, 4616084078092345356, 12686517019496357900, 5768847255977541644, 14990618443094405125, 1155648348474023941, 17296408673870921733, 10379037978051694597, 13837820080837038085, 2533326330986501, 2308464298890850309, 6920326238910255109, 16143575130999578629, 9226028509025005573, 3461544131829944325, 8073054228665282565, 11531783559724367877, 4614395266887311365, 12684828208291323909, 5767158444772507653, 14991462872318717953, 1156492777698336769, 17297253103095234561, 10379882407276007425, 13838664510061350913, 3377755555299329, 2309308728115163137, 6921170668134567937, 16144419560223891457, 9226872938249318401, 3462388561054257153, 8073898657889595393, 11532627988948680705, 4615239696111624193, 12685672637515636737, 5768002873996820481, 14988085116763418624, 1153115022143037440, 17293875347539935232, 10376504651720708096, 13835286754506051584, 0, 2305930972559863808, 6917792912579268608, 16141041804668592128, 9223495182694019072, 3459010805498957824, 8070520902334296064, 11529250233393381376, 4611861940556324864, 12682294881960337408, 5764625118441521152, 14988648088192266247, 1153677993571885063, 17294438318968782855, 10377067623149555719, 13835849725934899207, 562971428847623, 2306493943988711431, 6918355884008116231, 16141604776097439751, 9224058154122866695, 3459573776927805447, 8071083873763143687, 11529813204822228999, 4612424911985172487, 12682857853389185031, 5765188089870368775, 14989774031048716297, 1154803936428335113, 17295564261825232905, 10378193566006005769, 13836975668791349257, 1688914285297673, 2307619886845161481, 6919481826864566281, 16142730718953889801, 9225184096979316745, 3460699719784255497, 8072209816619593737, 11530939147678679049, 4613550854841622537, 12683983796245635081, 5766314032726818825, 14992025800797761542, 1157055706177380358, 17297816031574278150, 10380445335755051014, 13839227438540394502, 3940684034342918, 2309871656594206726, 6921733596613611526, 16144982488702935046, 9227435866728361990, 3462951489533300742, 8074461586368638982, 11533190917427724294, 4615802624590667782, 12686235565994680326, 5768565802475864070, 14990336946642006031, 1155366852021624847, 17296127177418522639, 10378756481599295503, 13837538584384638991, 2251829878587407, 2308182802438451215, 6920044742457856015, 16143293634547179535, 9225747012572606479, 3461262635377545231, 8072772732212883471, 11531502063271968783, 4614113770434912271, 12684546711838924815, 5766876948320108559, 14988929601823354893, 1153959507202973709, 17294719832599871501, 10377349136780644365, 13836131239565987853, 844485059936269, 2306775457619800077, 6918637397639204877, 16141886289728528397, 9224339667753955341, 3459855290558894093, 8071365387394232333, 11530094718453317645, 4612706425616261133, 12683139367020273677, 5765469603501457421, 14990055458780590083, 1155085364160208899, 17295845689557106691, 10378474993737879555, 13837257096523223043, 1970342017171459, 2307901314577035267, 6919763254596440067, 16143012146685763587, 9225465524711190531, 3460981147516129283, 8072491244351467523, 11531220575410552835, 4613832282573496323, 12684265223977508867, 5766595460458692611, 14990899875121180680, 1155929780500799496, 17296690105897697288, 10379319410078470152, 13838101512863813640, 2814758357762056, 2308745730917625864, 6920607670937030664, 16143856563026354184, 9226309941051781128, 3461825563856719880, 8073335660692058120, 11532064991751143432, 4614676698914086920, 12685109640318099464, 5767439876799283208, 14989211059619999758, 1154240964999618574, 17295001290396516366, 10377630594577289230, 13836412697362632718, 1125942856581134, 2307056915416444942, 6918918855435849742, 16142167747525173262, 9224621125550600206, 3460136748355538958, 8071646845190877198, 11530376176249962510, 4612987883412905998, 12683420824816918542, 5765751061298102286, 14991181380162334722, 1156211285541953538, 17296971610938851330, 10379600915119624194, 13838383017904967682, 3096263398916098, 2309027235958779906, 6920889175978184706, 16144138068067508226, 9226591446092935170, 3462107068897873922, 8073617165733212162, 11532346496792297474, 4614958203955240962, 12685391145359253506, 5767721381840437250, 14989492495942725636, 1154522401322344452, 17295282726719242244, 10377912030900015108, 13836694133685358596, 1407379179307012, 2307338351739170820, 6919200291758575620, 16142449183847899140, 9224902561873326084, 3460418184678264836, 8071928281513603076, 11530657612572688388, 4613269319735631876, 12683702261139644420, 5766032497620828164] r_cand_key_size_const_long = [5348033148747781, 14355232405585925, 32369630919262213, 32369699638738965, 32369837077692469, 27866512327180405, 23362912698761333, 14355713441923189, 32370043236122725, 32369974516645973, 27866237449273397, 18859313070342261, 5348514185085045, 14355644722446437, 32369905797169221, 27866100010319893, 23362637820854325, 9852113813504117, 23362843979284581, 14355576002969685, 27866168729796645, 18859175631388757, 844639678758965, 844845837189221, 5348308026654789, 9851632777166853, 23362431662424069, 14355301125062677, 32369768358215717, 27866374888226901, 18859038192435253, 844914556665973, 5348445465608293, 14355507283492933, 27866031290843141, 23362500381900821, 14355438564016181, 27866443607703653, 23362775259807829, 9851838935597109, 18859244350865509, 5348376746131541, 9851770216120357, 18859106911912005, 844502239805461, 5348170587701285, 9851907655073861, 18858832034004997] @classmethod def byte2ulong(cls, b, offSet): x = 0 for i in range(7, -1, -1): x = x << 8 ^ b[i + offSet] return x @classmethod def ulong2byte(cls, x): b = [None] * 8 for i in range(0, 8, 1): b[i] = x >> i * 8 & 255 return b @classmethod def ulong2byte_copy(cls, x, b, offSet): for i in range(0, 8, 1): b[offSet + i] = x >> i * 8 & 255 return @classmethod def add_key(cls, state, roundKey): return state ^ roundKey @classmethod def add_constants(cls, state, round): return state ^ cls.RCandKeySizeConstLong[round] @classmethod def sub_cell_shift_row_and_mix_columns(cls, state): temp = cls.T0[state >> 0 & 255] temp ^= cls.T1[state >> 8 & 255] temp ^= cls.T2[state >> 16 & 255] temp ^= cls.T3[state >> 24 & 255] temp ^= cls.T4[state >> 32 & 255] temp ^= cls.T5[state >> 40 & 255] temp ^= cls.T6[state >> 48 & 255] temp ^= cls.T7[state >> 56 & 255] return temp @classmethod def step(cls, state, step): for i in range(0, 4, 1): state = cls.AddConstants(state, step * 4 + i) state = cls.SubCellShiftRowAndMixColumns(state) return state @classmethod def encrypt_one_block(cls, state, sk0, sk1): for i in range(0, 12, 2): state = cls.AddKey(state, sk0) state = cls.Step(state, i) state = cls.AddKey(state, sk1) state = cls.Step(state, i + 1) state = cls.AddKey(state, sk0) return state @classmethod def encrypt(cls, plainText, key): cipher_text = [None] * len(plainText) sk0 = cls.byte2ulong(key, 0) sk2 = [None] * 8 for i in range(0, 8, 1): sk2[i] = key[(8 + i) % 10] sk1 = cls.byte2ulong(sk2, 0) for i in range(0, len(plainText), 8): state = cls.byte2ulong(plainText, i) state = cls.EncryptOneBlock(state, sk0, sk1) cls.ulong2byteCopy(state, cipherText, i) return cipherText
# https://leetcode.com/problems/jump-game/ class Solution: def canJump(self, nums: list[int]) -> bool: last = 0 for index in range(len(nums)): if index > last: return False last = max(last, index + nums[index]) if last >= len(nums) - 1: return True return True nums = [2, 3, 1, 1, 4] print(Solution().canJump(nums)) nums = [3, 2, 1, 0, 4] print(Solution().canJump(nums))
class Solution: def can_jump(self, nums: list[int]) -> bool: last = 0 for index in range(len(nums)): if index > last: return False last = max(last, index + nums[index]) if last >= len(nums) - 1: return True return True nums = [2, 3, 1, 1, 4] print(solution().canJump(nums)) nums = [3, 2, 1, 0, 4] print(solution().canJump(nums))
def calculate(mass): if mass < 6: return 0 return int(mass/3-2) + calculate(int(mass/3-2)) with open("1.txt", "r") as infile: print("First part solution: ", sum([int(int(x)/3)-2 for x in infile.readlines()])) print("Second part solution: ", sum([calculate(int(x)) for x in infile.readlines()]))
def calculate(mass): if mass < 6: return 0 return int(mass / 3 - 2) + calculate(int(mass / 3 - 2)) with open('1.txt', 'r') as infile: print('First part solution: ', sum([int(int(x) / 3) - 2 for x in infile.readlines()])) print('Second part solution: ', sum([calculate(int(x)) for x in infile.readlines()]))
class Dimension: def __init__(self, x1, y1, x2, y2): self.x1 = x1 self.y1 = y1 self.x2 = x2 self.y2 = y2 @property def width(self): return self.x2 - self.x1 @property def height(self): return self.y2 - self.y1 @property def aspect_ratio(self): if self.height > 0: return self.width / self.height return self.width def wider(self, other_dimension): return self.aspect_ratio > other_dimension.aspect_ratio def __str__(self): return "{} {} {} {}".format(self.x1, self.y1, self.x2, self.y2) class Decider: def __init__(self, np_array): self.upvote = True self.decided = True self.__process__(np_array) def __process__(self, np_array): if len(np_array) < 2: self.decided = False return dimensions = [] def give_me_dimensions(block): min_x = block[0][0][0] min_y = block[0][0][1] max_x = block[0][0][0] max_y = block[0][0][1] for point in block: x = point[0][0] y = point[0][1] if min_x > x: min_x = x elif max_x < x: max_x = x if min_y > y: min_y = y elif max_y < y: max_y = y return Dimension(min_x, min_y, max_x, max_y) self.thumb_area = 0 self.palm_area = 0 i = 0 for i, hull in enumerate(np_array): hull_rectangle = give_me_dimensions(hull) dimensions.append(hull_rectangle) if hull_rectangle.wider(dimensions[self.palm_area]): self.palm_area = i elif dimensions[self.thumb_area].wider(hull_rectangle): self.thumb_area = i if dimensions[self.thumb_area].aspect_ratio < 0.2: print( "Too low aspect ratio {}".format( dimensions[self.thumb_area].aspect_ratio ) ) self.decided = False return upvote_patterns = 0 downvote_patterns = 0 if (dimensions[self.thumb_area].y2 + dimensions[self.thumb_area].y1) / 2 > ( dimensions[self.palm_area].y2 + dimensions[self.palm_area].y1 ) / 2: upvote_patterns += 1 else: downvote_patterns += 1 if dimensions[self.thumb_area].y1 < dimensions[self.palm_area].y1: higher = 0 lower = 0 total = 0 for dimension in dimensions: if dimension not in ( dimensions[self.thumb_area], dimensions[self.palm_area], ): total += 1 if dimensions[self.thumb_area].y2 > dimension.y2: higher += 1 if dimensions[self.thumb_area].y1 < dimension.y1: lower += 1 if higher + lower < total * 1.5: if higher > lower + 1 + total * 0.2: upvote_patterns += 1 elif lower > higher + 1 + total * 0.2: downvote_patterns += 1 if dimensions[self.thumb_area].y2 > dimensions[self.palm_area].y2: downvote_patterns += 1 if dimensions[self.thumb_area].y1 < dimensions[self.palm_area].y1: upvote_patterns += 1 rules_count = 3 if upvote_patterns > rules_count / 2: self.upvote = True elif downvote_patterns > rules_count / 2: self.upvote = False else: self.decided = False def is_upvote(self): return self.upvote def is_decided(self): return self.decided def __thumb_area(self): return self.thumb_area def __palm_area(self): return self.palm_area
class Dimension: def __init__(self, x1, y1, x2, y2): self.x1 = x1 self.y1 = y1 self.x2 = x2 self.y2 = y2 @property def width(self): return self.x2 - self.x1 @property def height(self): return self.y2 - self.y1 @property def aspect_ratio(self): if self.height > 0: return self.width / self.height return self.width def wider(self, other_dimension): return self.aspect_ratio > other_dimension.aspect_ratio def __str__(self): return '{} {} {} {}'.format(self.x1, self.y1, self.x2, self.y2) class Decider: def __init__(self, np_array): self.upvote = True self.decided = True self.__process__(np_array) def __process__(self, np_array): if len(np_array) < 2: self.decided = False return dimensions = [] def give_me_dimensions(block): min_x = block[0][0][0] min_y = block[0][0][1] max_x = block[0][0][0] max_y = block[0][0][1] for point in block: x = point[0][0] y = point[0][1] if min_x > x: min_x = x elif max_x < x: max_x = x if min_y > y: min_y = y elif max_y < y: max_y = y return dimension(min_x, min_y, max_x, max_y) self.thumb_area = 0 self.palm_area = 0 i = 0 for (i, hull) in enumerate(np_array): hull_rectangle = give_me_dimensions(hull) dimensions.append(hull_rectangle) if hull_rectangle.wider(dimensions[self.palm_area]): self.palm_area = i elif dimensions[self.thumb_area].wider(hull_rectangle): self.thumb_area = i if dimensions[self.thumb_area].aspect_ratio < 0.2: print('Too low aspect ratio {}'.format(dimensions[self.thumb_area].aspect_ratio)) self.decided = False return upvote_patterns = 0 downvote_patterns = 0 if (dimensions[self.thumb_area].y2 + dimensions[self.thumb_area].y1) / 2 > (dimensions[self.palm_area].y2 + dimensions[self.palm_area].y1) / 2: upvote_patterns += 1 else: downvote_patterns += 1 if dimensions[self.thumb_area].y1 < dimensions[self.palm_area].y1: higher = 0 lower = 0 total = 0 for dimension in dimensions: if dimension not in (dimensions[self.thumb_area], dimensions[self.palm_area]): total += 1 if dimensions[self.thumb_area].y2 > dimension.y2: higher += 1 if dimensions[self.thumb_area].y1 < dimension.y1: lower += 1 if higher + lower < total * 1.5: if higher > lower + 1 + total * 0.2: upvote_patterns += 1 elif lower > higher + 1 + total * 0.2: downvote_patterns += 1 if dimensions[self.thumb_area].y2 > dimensions[self.palm_area].y2: downvote_patterns += 1 if dimensions[self.thumb_area].y1 < dimensions[self.palm_area].y1: upvote_patterns += 1 rules_count = 3 if upvote_patterns > rules_count / 2: self.upvote = True elif downvote_patterns > rules_count / 2: self.upvote = False else: self.decided = False def is_upvote(self): return self.upvote def is_decided(self): return self.decided def __thumb_area(self): return self.thumb_area def __palm_area(self): return self.palm_area
with open("../documentation/resource-doc.txt", "r") as DOC_FILE: __doc__ = DOC_FILE.read() def repositionItemInList(__index, __item, __list): __list.remove(__item) __list.insert(__index, __item) return __list def removeItems(__item_list, __list): for item in __item_list: try: __list.remove(item) except ValueError: continue return __list def removeNonePyExtensions(__list): has_py_extension_conditional = {1: (lambda: 0)} invalid_items = [] for item in __list: try: has_py_extension_conditional[(item.split(".")[1] == "py") + 0]() except (KeyError, IndexError): invalid_items.append(item) __list = removeItems(invalid_items, __list) return __list
with open('../documentation/resource-doc.txt', 'r') as doc_file: __doc__ = DOC_FILE.read() def reposition_item_in_list(__index, __item, __list): __list.remove(__item) __list.insert(__index, __item) return __list def remove_items(__item_list, __list): for item in __item_list: try: __list.remove(item) except ValueError: continue return __list def remove_none_py_extensions(__list): has_py_extension_conditional = {1: lambda : 0} invalid_items = [] for item in __list: try: has_py_extension_conditional[(item.split('.')[1] == 'py') + 0]() except (KeyError, IndexError): invalid_items.append(item) __list = remove_items(invalid_items, __list) return __list
# An example with subplots, so an array of axes is returned. axes = df.plot.line(subplots=True) type(axes) # <class 'numpy.ndarray'>
axes = df.plot.line(subplots=True) type(axes)
class Statistics(): def __init__(self): self.time_cfg_constr = 0 #ok self.time_verify = 0 #ok self.time_smt = 0 #ok self.time_smt_pure = 0 self.time_interp = 0 #ok self.time_interp_pure = 0 #ok self.time_to_lia = 0 #ok self.time_from_lia = 0 #ok self.time_process_lia = 0 self.sizes_interpol = [] #ok self.num_smt = 0 #ok self.num_interp = 0 #ok self.num_interp_failure = 0 #ok self.num_boxing = 0 self.num_boxing_multi_variable = 0 self.giveup_print_unwind = False #ok self.counter_path_id = None self.counter_model = None self.counter_path_pred = None self.bitwidth = None self.theory = None def to_dict(self): return {"time_cfg_constr": self.time_cfg_constr, "time_verify": self.time_verify, "time_smt": self.time_smt, "time_interp": self.time_interp, "time_to_lia": self.time_to_lia, "time_from_lia": self.time_from_lia, "sizes_interpol": self.sizes_interpol, "num_smt": self.num_smt, "num_interp": self.num_interp, "num_interp_failure": self.num_interp_failure, "giveup_print_unwind": self.giveup_print_unwind, "counter_path_id": self.counter_path_id, "counter_model": self.counter_model, "counter_path_pred": self.counter_path_pred, "time_smt_pure": self.time_smt_pure, "time_interp_pure": self.time_interp_pure, "time_process_lia": self.time_process_lia, "bitwidth": self.bitwidth, "theory": self.theory, "num_boxing": self.num_boxing, "num_boxing_multi_variable": self.num_boxing_multi_variable }
class Statistics: def __init__(self): self.time_cfg_constr = 0 self.time_verify = 0 self.time_smt = 0 self.time_smt_pure = 0 self.time_interp = 0 self.time_interp_pure = 0 self.time_to_lia = 0 self.time_from_lia = 0 self.time_process_lia = 0 self.sizes_interpol = [] self.num_smt = 0 self.num_interp = 0 self.num_interp_failure = 0 self.num_boxing = 0 self.num_boxing_multi_variable = 0 self.giveup_print_unwind = False self.counter_path_id = None self.counter_model = None self.counter_path_pred = None self.bitwidth = None self.theory = None def to_dict(self): return {'time_cfg_constr': self.time_cfg_constr, 'time_verify': self.time_verify, 'time_smt': self.time_smt, 'time_interp': self.time_interp, 'time_to_lia': self.time_to_lia, 'time_from_lia': self.time_from_lia, 'sizes_interpol': self.sizes_interpol, 'num_smt': self.num_smt, 'num_interp': self.num_interp, 'num_interp_failure': self.num_interp_failure, 'giveup_print_unwind': self.giveup_print_unwind, 'counter_path_id': self.counter_path_id, 'counter_model': self.counter_model, 'counter_path_pred': self.counter_path_pred, 'time_smt_pure': self.time_smt_pure, 'time_interp_pure': self.time_interp_pure, 'time_process_lia': self.time_process_lia, 'bitwidth': self.bitwidth, 'theory': self.theory, 'num_boxing': self.num_boxing, 'num_boxing_multi_variable': self.num_boxing_multi_variable}
class Gen: def __init__(self, type, sequence, data_object): self.type = type self.sequence = sequence self.data_object = data_object class GenType: CDNA = 'cdna' DNA = 'dna' CDS = 'cds' class DnaType: dna = '.dna.' dna_sm = '.dna_sm.' dna_rm = '.dna_rm.'
class Gen: def __init__(self, type, sequence, data_object): self.type = type self.sequence = sequence self.data_object = data_object class Gentype: cdna = 'cdna' dna = 'dna' cds = 'cds' class Dnatype: dna = '.dna.' dna_sm = '.dna_sm.' dna_rm = '.dna_rm.'
# Insert line numbers in_file = open('Resources/02. Line Numbers/Input.txt', 'r').read().split('\n') result = [str(number + 1) + '. ' + item for number, item in enumerate(in_file)][:-1] print(*result, sep = '\n') out_str = '\n'.join(result) open('output/02.txt', 'w').write(out_str)
in_file = open('Resources/02. Line Numbers/Input.txt', 'r').read().split('\n') result = [str(number + 1) + '. ' + item for (number, item) in enumerate(in_file)][:-1] print(*result, sep='\n') out_str = '\n'.join(result) open('output/02.txt', 'w').write(out_str)
fib = lambda n: n if n <= 2 else fib(n - 1) + fib(n - 2) ''' print(fib(10)) #89 '''
fib = lambda n: n if n <= 2 else fib(n - 1) + fib(n - 2) '\nprint(fib(10)) #89 \n'
# Searvice Check Config #### Global DOMAIN = 'TEAM' ### HTTP HTTP_PAGES = [ { 'url':'', 'expected':'index.html', 'tolerance': 0.05 }, ] ### HTTPS HTTPS_PAGES = [ { 'url':'', 'expected':'index.html', 'tolerance': 0.05 }, ] ### DNS DNS_QUERIES = [ { 'type':'A', 'query':'team.local', 'expected':'216.239.32.10' }, ] ### FTP FTP_FILES = [ { 'path':'/testfile.txt', 'checksum':'12345ABCDEF' }, ] ### SMB SMB_FILES = [ { 'sharename':'ftproot', 'path':'/index.html', 'checksum':'83e503650ffd301b55538ea896afbcedea0c79c2' }, ] ### MSSQL MSSQL_QUERIES = [ { 'db': 'employee_data', 'query': 'SELECT SSN FROM dbo.hr_info WHERE LastName LIKE \'Erikson\'', 'response': '122751924' }, ] ### MYSQL MYSQL_QUERIES = [ { 'db': 'mysql', 'query': 'SELECT password FROM user WHERE user=\'root\' AND host=\'localhost\'', 'response': '*9CFBBC772F3F6C106020035386DA5BBBF1249A11' } ] ### SMTP SMTP_ADDRESSES = [ '[email protected]', '[email protected]', ] ### LDAP LDAP_QUERIES = [ { 'dn': '%[email protected]', 'base': 'cn=users,dc=team,dc=vnet', 'filter':'(&(objectClass=*)(cn=Administrator))', 'attributes':['sAMAccountName'], 'expected':{'sAMAccountName': ['Administrator']} }, ] # Services Config SERVICES = [ { 'name':'http', 'subnet_host':'152', 'port':80, 'plugin':'http' }, { 'name':'ssh', 'subnet_host':'152', 'port':22, 'plugin':'ssh' }, { 'name':'dns', 'subnet_host':'152', 'port':53, 'plugin':'dns' }, { 'name':'imap', 'subnet_host':'152', 'port':143, 'plugin':'imap' }, { 'name':'pop', 'subnet_host':'152', 'port':110, 'plugin':'pop' }, { 'name':'smtp', 'subnet_host':'152', 'port':25, 'plugin':'smtp' }, { 'name':'ldap', 'subnet_host':'134', 'port':389, 'plugin':'ldap' }, { 'name':'ftp', 'subnet_host':'152', 'port':21, 'plugin':'ftp' }, { 'name':'mssql', 'subnet_host':'152', 'port':3308, 'plugin':'mssql' }, { 'name':'mysql', 'subnet_host':'152', 'port':3309, 'plugin':'mysql' }, { 'name':'https', 'subnet_host':'152', 'port':443, 'plugin':'https' }, { 'name':'smb', 'subnet_host':'134', 'port':139, 'plugin':'smb' }, ] # Default Credentials Config DEFAULT_CREDS = [ { 'username':'joe', 'password':'toor', 'services':['http', 'ssh', 'dns', 'imap', 'pop', 'smtp', 'ftp', 'mssql', 'mysql', 'https'] }, { 'username':'nic', 'password':'toor', 'services':['http', 'ssh', 'dns', 'imap', 'pop', 'smtp'] }, { 'username':'Administrator', 'password':'P@ssword1', 'services':['ldap', 'smb'] }, ] # Team Config TEAMS = [ { 'name': 'Team 1', 'subnet': '192.168.1.0', 'netmask': '255.255.255.0' }, { 'name': 'Team 2', 'subnet': '192.168.2.0', 'netmask': '255.255.255.0' }, ]
domain = 'TEAM' http_pages = [{'url': '', 'expected': 'index.html', 'tolerance': 0.05}] https_pages = [{'url': '', 'expected': 'index.html', 'tolerance': 0.05}] dns_queries = [{'type': 'A', 'query': 'team.local', 'expected': '216.239.32.10'}] ftp_files = [{'path': '/testfile.txt', 'checksum': '12345ABCDEF'}] smb_files = [{'sharename': 'ftproot', 'path': '/index.html', 'checksum': '83e503650ffd301b55538ea896afbcedea0c79c2'}] mssql_queries = [{'db': 'employee_data', 'query': "SELECT SSN FROM dbo.hr_info WHERE LastName LIKE 'Erikson'", 'response': '122751924'}] mysql_queries = [{'db': 'mysql', 'query': "SELECT password FROM user WHERE user='root' AND host='localhost'", 'response': '*9CFBBC772F3F6C106020035386DA5BBBF1249A11'}] smtp_addresses = ['[email protected]', '[email protected]'] ldap_queries = [{'dn': '%[email protected]', 'base': 'cn=users,dc=team,dc=vnet', 'filter': '(&(objectClass=*)(cn=Administrator))', 'attributes': ['sAMAccountName'], 'expected': {'sAMAccountName': ['Administrator']}}] services = [{'name': 'http', 'subnet_host': '152', 'port': 80, 'plugin': 'http'}, {'name': 'ssh', 'subnet_host': '152', 'port': 22, 'plugin': 'ssh'}, {'name': 'dns', 'subnet_host': '152', 'port': 53, 'plugin': 'dns'}, {'name': 'imap', 'subnet_host': '152', 'port': 143, 'plugin': 'imap'}, {'name': 'pop', 'subnet_host': '152', 'port': 110, 'plugin': 'pop'}, {'name': 'smtp', 'subnet_host': '152', 'port': 25, 'plugin': 'smtp'}, {'name': 'ldap', 'subnet_host': '134', 'port': 389, 'plugin': 'ldap'}, {'name': 'ftp', 'subnet_host': '152', 'port': 21, 'plugin': 'ftp'}, {'name': 'mssql', 'subnet_host': '152', 'port': 3308, 'plugin': 'mssql'}, {'name': 'mysql', 'subnet_host': '152', 'port': 3309, 'plugin': 'mysql'}, {'name': 'https', 'subnet_host': '152', 'port': 443, 'plugin': 'https'}, {'name': 'smb', 'subnet_host': '134', 'port': 139, 'plugin': 'smb'}] default_creds = [{'username': 'joe', 'password': 'toor', 'services': ['http', 'ssh', 'dns', 'imap', 'pop', 'smtp', 'ftp', 'mssql', 'mysql', 'https']}, {'username': 'nic', 'password': 'toor', 'services': ['http', 'ssh', 'dns', 'imap', 'pop', 'smtp']}, {'username': 'Administrator', 'password': 'P@ssword1', 'services': ['ldap', 'smb']}] teams = [{'name': 'Team 1', 'subnet': '192.168.1.0', 'netmask': '255.255.255.0'}, {'name': 'Team 2', 'subnet': '192.168.2.0', 'netmask': '255.255.255.0'}]
class FakeTwilioMessage(object): status = 'sent' def __init__(self, price, num_segments=1): self.price = price self.num_segments = str(num_segments) def fetch(self): return self class FakeMessageFactory(object): backend_message_id_to_num_segments = {} backend_message_id_to_price = {} @classmethod def add_price_for_message(cls, backend_message_id, price): cls.backend_message_id_to_price[backend_message_id] = price @classmethod def get_price_for_message(cls, backend_message_id): return cls.backend_message_id_to_price.get(backend_message_id) @classmethod def add_num_segments_for_message(cls, backend_message_id, num_segments): cls.backend_message_id_to_num_segments[backend_message_id] = num_segments @classmethod def get_num_segments_for_message(cls, backend_message_id): return cls.backend_message_id_to_num_segments.get(backend_message_id) or 1 @classmethod def get_twilio_message(cls, backend_message_id): return FakeTwilioMessage( cls.get_price_for_message(backend_message_id) * -1, num_segments=cls.get_num_segments_for_message(backend_message_id), ) @classmethod def get_infobip_message(cls, backend_message_id): return { 'messageCount': cls.get_num_segments_for_message(backend_message_id), 'status': { 'name': 'sent' }, 'price': { 'pricePerMessage': cls.get_price_for_message(backend_message_id) } }
class Faketwiliomessage(object): status = 'sent' def __init__(self, price, num_segments=1): self.price = price self.num_segments = str(num_segments) def fetch(self): return self class Fakemessagefactory(object): backend_message_id_to_num_segments = {} backend_message_id_to_price = {} @classmethod def add_price_for_message(cls, backend_message_id, price): cls.backend_message_id_to_price[backend_message_id] = price @classmethod def get_price_for_message(cls, backend_message_id): return cls.backend_message_id_to_price.get(backend_message_id) @classmethod def add_num_segments_for_message(cls, backend_message_id, num_segments): cls.backend_message_id_to_num_segments[backend_message_id] = num_segments @classmethod def get_num_segments_for_message(cls, backend_message_id): return cls.backend_message_id_to_num_segments.get(backend_message_id) or 1 @classmethod def get_twilio_message(cls, backend_message_id): return fake_twilio_message(cls.get_price_for_message(backend_message_id) * -1, num_segments=cls.get_num_segments_for_message(backend_message_id)) @classmethod def get_infobip_message(cls, backend_message_id): return {'messageCount': cls.get_num_segments_for_message(backend_message_id), 'status': {'name': 'sent'}, 'price': {'pricePerMessage': cls.get_price_for_message(backend_message_id)}}
class ValueNotRequired(Exception): pass class RaggedListError(Exception): pass
class Valuenotrequired(Exception): pass class Raggedlisterror(Exception): pass
# AUTOGENERATED BY NBDEV! DO NOT EDIT! __all__ = ["index", "modules", "custom_doc_links", "git_url"] index = {"AttStats": "att_stats.ipynb", "Attribute": "attribute.ipynb", "Data": "data.ipynb", "DataScrambler": "data_scrambler.ipynb", "configuration": "data_scrambler.ipynb", "EntropyEvaluator": "entropy_evaluator.ipynb", "Instance": "instance.ipynb", "ParseException": "parse_exception.ipynb", "Reading": "reading.ipynb", "ToHMLDemo": "to_HML_demo.ipynb", "Tree": "tree.ipynb", "Condition": "tree.ipynb", "TreeEdge": "tree_edge.ipynb", "TreeEvaluator": "tree_evaluator.ipynb", "BenchmarkResult": "tree_evaluator.ipynb", "Prediction": "tree_evaluator.ipynb", "Stats": "tree_evaluator.ipynb", "TreeNode": "tree_node.ipynb", "UId3": "uId3.ipynb", "UncertainEntropyEvaluator": "uncertain_entropy_evaluator.ipynb", "Value": "value.ipynb"} modules = ["att_stats.py", "attribute.py", "data.py", "data_scrambler.py", "entropy_evaluator.py", "instance.py", "parse_exception.py", "reading.py", "to_hml_demo.py", "tree.py", "tree_edge.py", "tree_evaluator.py", "tree_node.py", "uid3.py", "uncertain_entropy_evaluator.py", "value.py"] doc_url = "https://anetakaczynska.github.io/uid3/" git_url = "https://github.com/anetakaczynska/uid3/tree/master/" def custom_doc_links(name): return None
__all__ = ['index', 'modules', 'custom_doc_links', 'git_url'] index = {'AttStats': 'att_stats.ipynb', 'Attribute': 'attribute.ipynb', 'Data': 'data.ipynb', 'DataScrambler': 'data_scrambler.ipynb', 'configuration': 'data_scrambler.ipynb', 'EntropyEvaluator': 'entropy_evaluator.ipynb', 'Instance': 'instance.ipynb', 'ParseException': 'parse_exception.ipynb', 'Reading': 'reading.ipynb', 'ToHMLDemo': 'to_HML_demo.ipynb', 'Tree': 'tree.ipynb', 'Condition': 'tree.ipynb', 'TreeEdge': 'tree_edge.ipynb', 'TreeEvaluator': 'tree_evaluator.ipynb', 'BenchmarkResult': 'tree_evaluator.ipynb', 'Prediction': 'tree_evaluator.ipynb', 'Stats': 'tree_evaluator.ipynb', 'TreeNode': 'tree_node.ipynb', 'UId3': 'uId3.ipynb', 'UncertainEntropyEvaluator': 'uncertain_entropy_evaluator.ipynb', 'Value': 'value.ipynb'} modules = ['att_stats.py', 'attribute.py', 'data.py', 'data_scrambler.py', 'entropy_evaluator.py', 'instance.py', 'parse_exception.py', 'reading.py', 'to_hml_demo.py', 'tree.py', 'tree_edge.py', 'tree_evaluator.py', 'tree_node.py', 'uid3.py', 'uncertain_entropy_evaluator.py', 'value.py'] doc_url = 'https://anetakaczynska.github.io/uid3/' git_url = 'https://github.com/anetakaczynska/uid3/tree/master/' def custom_doc_links(name): return None
# fixing the issue in food.py # this is kind of a bug, thats not what we wanted # this can be done by making the class variable an instance variable class Food: def __init__(self, name): self.name = name # instance variable (attr) self.fav_food = [] # class variable fix by making inst var def set_fav_food(self, food: str): self.fav_food.append(food) person_a = Food('jerry') person_a.set_fav_food('rice and pancake') # person_a can access its own fav_food print(person_a.fav_food) person_b = Food('Lee') person_b.set_fav_food('roated groundnut and catchup') print(person_b.fav_food) # when you check the output, you realise that the second instance doesn't modifies # the fav_food variable
class Food: def __init__(self, name): self.name = name self.fav_food = [] def set_fav_food(self, food: str): self.fav_food.append(food) person_a = food('jerry') person_a.set_fav_food('rice and pancake') print(person_a.fav_food) person_b = food('Lee') person_b.set_fav_food('roated groundnut and catchup') print(person_b.fav_food)
''' People module for the Derrida project. It provides basic personography, VIAF lookup, and admin functionality to edit people associated with Derrida's library. ''' default_app_config = 'derrida.people.apps.PeopleConfig'
""" People module for the Derrida project. It provides basic personography, VIAF lookup, and admin functionality to edit people associated with Derrida's library. """ default_app_config = 'derrida.people.apps.PeopleConfig'
def calc_size(digest_size, seed_size, num_rounds, lowmc_k, lowmc_r, lowmc_m, is_unruh): lowmc_n = lowmc_k # bytes required to store one input share input_size = (lowmc_k + 7) >> 3; # bytes required to store one output share output_size = (lowmc_n + 7) >> 3; # number of bits per view per LowMC round view_round_size = lowmc_m * 3; # bytes required to store communicated bits (i.e. views) of one round view_size = (view_round_size * lowmc_r + 7) >> 3; # bytes required to store collapsed challenge collapsed_challenge_size = (num_rounds + 3) >> 2; if is_unruh: unruh_without_input_bytes_size = seed_size + view_size; unruh_with_input_bytes_size = unruh_without_input_bytes_size + input_size; else: unruh_without_input_bytes_size = unruh_with_input_bytes_size = 0; # we can use unruh_without_input_bytes_size here. In call cases where we need # to write more, we do not need to write the input share per_round_size = input_size + view_size + digest_size + 2 * seed_size + unruh_without_input_bytes_size; max_signature_size = collapsed_challenge_size + 32 + num_rounds * per_round_size; print(unruh_without_input_bytes_size, unruh_with_input_bytes_size, max_signature_size) # Picnic with partial Sbox layer calc_size(32, 16, 219, 128, 20, 10, False) calc_size(32, 16, 219, 128, 20, 10, True) calc_size(48, 24, 329, 192, 30, 10, False) calc_size(48, 24, 329, 192, 30, 10, True) calc_size(64, 32, 438, 256, 38, 10, False) calc_size(64, 32, 438, 256, 38, 10, True) # Picnic with full Sbox layer calc_size(32, 16, 219, 129, 4, 43, False) calc_size(48, 24, 329, 192, 4, 64, False) calc_size(64, 32, 438, 255, 4, 85, False)
def calc_size(digest_size, seed_size, num_rounds, lowmc_k, lowmc_r, lowmc_m, is_unruh): lowmc_n = lowmc_k input_size = lowmc_k + 7 >> 3 output_size = lowmc_n + 7 >> 3 view_round_size = lowmc_m * 3 view_size = view_round_size * lowmc_r + 7 >> 3 collapsed_challenge_size = num_rounds + 3 >> 2 if is_unruh: unruh_without_input_bytes_size = seed_size + view_size unruh_with_input_bytes_size = unruh_without_input_bytes_size + input_size else: unruh_without_input_bytes_size = unruh_with_input_bytes_size = 0 per_round_size = input_size + view_size + digest_size + 2 * seed_size + unruh_without_input_bytes_size max_signature_size = collapsed_challenge_size + 32 + num_rounds * per_round_size print(unruh_without_input_bytes_size, unruh_with_input_bytes_size, max_signature_size) calc_size(32, 16, 219, 128, 20, 10, False) calc_size(32, 16, 219, 128, 20, 10, True) calc_size(48, 24, 329, 192, 30, 10, False) calc_size(48, 24, 329, 192, 30, 10, True) calc_size(64, 32, 438, 256, 38, 10, False) calc_size(64, 32, 438, 256, 38, 10, True) calc_size(32, 16, 219, 129, 4, 43, False) calc_size(48, 24, 329, 192, 4, 64, False) calc_size(64, 32, 438, 255, 4, 85, False)
def visit_rate_ate(df, test_set=False): if test_set: treatment_visit_rate = df[df.Treatment == 1].Outcome.mean() * 100 control_visit_rate = df[df.Treatment == 0].Outcome.mean() * 100 average_treatment_effect = treatment_visit_rate - control_visit_rate print("Test set visit rate uplift: {:.2f}%".format(average_treatment_effect)) return average_treatment_effect else: mens = df[df.segment == "Mens E-Mail"].visit.mean() * 100 womens = df[df.segment == "Womens E-Mail"].visit.mean() * 100 control = df[df.segment == "No E-Mail"].visit.mean() * 100 print("Men's E-Mail visit rate: {:.2f}%".format(mens)) print("Women's E-Mail visit rate: {:.2f}%".format(womens)) print("Control E-mail visit Rate: {:.2f}%".format(control)) print("---------------------------------") print("Men's visit rate uplift: {:.2f}%".format(mens - control)) print("Women's visit rate uplift: {:.2f}%".format(womens - control)) def conversion_rate_ate(df): mens = df[df.segment == "Mens E-Mail"].conversion.mean() * 100 womens = df[df.segment == "Womens E-Mail"].conversion.mean() * 100 control = df[df.segment == "No E-Mail"].conversion.mean() * 100 print("Men's E-Mail conversion rate: {:.2f}%".format(mens)) print("Women's E-Mail conversion rate: {:.2f}%".format(womens)) print("Control E-mail conversion Rate: {:.2f}%".format(control)) print("---------------------------------") print("Men's conversion rate uplift: {:.2f}%".format(mens - control)) print("Women's conversion rate uplift: {:.2f}%".format(womens - control)) def spending_ate(df): mens = df[df.segment == "Mens E-Mail"].spend.mean() womens = df[df.segment == "Womens E-Mail"].spend.mean() control = df[df.segment == "No E-Mail"].spend.mean() print("Men's E-Mail spending: ${:.2f}".format(mens)) print("Women's E-Mail spending: ${:.2f}".format(womens)) print("Control E-mail spending: ${:.2f}".format(control)) print("---------------------------------") print("Men's spending uplift: ${:.2f}".format(mens - control)) print("Women's spending uplift: ${:.2f}".format(womens - control)) def spend_given_purchase(df): print("Men's average spend given purchase: ${:.2f}".format( df[(df.conversion == 1) & (df.segment == 'Mens E-Mail')].spend.mean())) print("Women's average spend given purchase: ${:.2f}".format( df[(df.conversion == 1) & (df.segment == 'Womens E-Mail')].spend.mean())) print("Control average spend given purchase: ${:.2f}".format( df[(df.conversion == 1) & (df.segment == 'No E-Mail')].spend.mean())) def purchase_given_visit(df): print("Men's purchase rate given visit: {:.2f}%".format(100 * ( len(df[(df.conversion == 1) & (df.segment == 'Mens E-Mail')]) / len( df[(df.visit == 1) & (df.segment == 'Mens E-Mail')])))) print("Women's purchase rate given visit: {:.2f}%".format(100 * ( len(df[(df.conversion == 1) & (df.segment == 'Womens E-Mail')]) / len( df[(df.visit == 1) & (df.segment == 'Womens E-Mail')])))) print("Control purchase rate given visit: {:.2f}%".format(100 * ( len(df[(df.conversion == 1) & (df.segment == 'No E-Mail')]) / len( df[(df.visit == 1) & (df.segment == 'No E-Mail')])))) def visit_rate(df): print("Men's visit rate: {:.2f}%".format( 100 * (len(df[(df.visit == 1) & (df.segment == 'Mens E-Mail')]) / len(df[(df.segment == 'Mens E-Mail')])))) print("Women's visit rate: {:.2f}%".format( 100 * (len(df[(df.visit == 1) & (df.segment == 'Womens E-Mail')]) / len(df[(df.segment == 'Womens E-Mail')])))) print("Control visit rate: {:.2f}%".format( 100 * (len(df[(df.visit == 1) & (df.segment == 'No E-Mail')]) / len(df[(df.segment == 'No E-Mail')])))) def spend_per_head(df): print("Men's mean spend: ${:.2f}".format(df[(df.segment == 'Mens E-Mail')].spend.mean())) print("Women's mean spend: ${:.2f}".format(df[(df.segment == 'Womens E-Mail')].spend.mean())) print("Control mean spend: ${:.2f}".format(df[(df.segment == 'No E-Mail')].spend.mean()))
def visit_rate_ate(df, test_set=False): if test_set: treatment_visit_rate = df[df.Treatment == 1].Outcome.mean() * 100 control_visit_rate = df[df.Treatment == 0].Outcome.mean() * 100 average_treatment_effect = treatment_visit_rate - control_visit_rate print('Test set visit rate uplift: {:.2f}%'.format(average_treatment_effect)) return average_treatment_effect else: mens = df[df.segment == 'Mens E-Mail'].visit.mean() * 100 womens = df[df.segment == 'Womens E-Mail'].visit.mean() * 100 control = df[df.segment == 'No E-Mail'].visit.mean() * 100 print("Men's E-Mail visit rate: {:.2f}%".format(mens)) print("Women's E-Mail visit rate: {:.2f}%".format(womens)) print('Control E-mail visit Rate: {:.2f}%'.format(control)) print('---------------------------------') print("Men's visit rate uplift: {:.2f}%".format(mens - control)) print("Women's visit rate uplift: {:.2f}%".format(womens - control)) def conversion_rate_ate(df): mens = df[df.segment == 'Mens E-Mail'].conversion.mean() * 100 womens = df[df.segment == 'Womens E-Mail'].conversion.mean() * 100 control = df[df.segment == 'No E-Mail'].conversion.mean() * 100 print("Men's E-Mail conversion rate: {:.2f}%".format(mens)) print("Women's E-Mail conversion rate: {:.2f}%".format(womens)) print('Control E-mail conversion Rate: {:.2f}%'.format(control)) print('---------------------------------') print("Men's conversion rate uplift: {:.2f}%".format(mens - control)) print("Women's conversion rate uplift: {:.2f}%".format(womens - control)) def spending_ate(df): mens = df[df.segment == 'Mens E-Mail'].spend.mean() womens = df[df.segment == 'Womens E-Mail'].spend.mean() control = df[df.segment == 'No E-Mail'].spend.mean() print("Men's E-Mail spending: ${:.2f}".format(mens)) print("Women's E-Mail spending: ${:.2f}".format(womens)) print('Control E-mail spending: ${:.2f}'.format(control)) print('---------------------------------') print("Men's spending uplift: ${:.2f}".format(mens - control)) print("Women's spending uplift: ${:.2f}".format(womens - control)) def spend_given_purchase(df): print("Men's average spend given purchase: ${:.2f}".format(df[(df.conversion == 1) & (df.segment == 'Mens E-Mail')].spend.mean())) print("Women's average spend given purchase: ${:.2f}".format(df[(df.conversion == 1) & (df.segment == 'Womens E-Mail')].spend.mean())) print('Control average spend given purchase: ${:.2f}'.format(df[(df.conversion == 1) & (df.segment == 'No E-Mail')].spend.mean())) def purchase_given_visit(df): print("Men's purchase rate given visit: {:.2f}%".format(100 * (len(df[(df.conversion == 1) & (df.segment == 'Mens E-Mail')]) / len(df[(df.visit == 1) & (df.segment == 'Mens E-Mail')])))) print("Women's purchase rate given visit: {:.2f}%".format(100 * (len(df[(df.conversion == 1) & (df.segment == 'Womens E-Mail')]) / len(df[(df.visit == 1) & (df.segment == 'Womens E-Mail')])))) print('Control purchase rate given visit: {:.2f}%'.format(100 * (len(df[(df.conversion == 1) & (df.segment == 'No E-Mail')]) / len(df[(df.visit == 1) & (df.segment == 'No E-Mail')])))) def visit_rate(df): print("Men's visit rate: {:.2f}%".format(100 * (len(df[(df.visit == 1) & (df.segment == 'Mens E-Mail')]) / len(df[df.segment == 'Mens E-Mail'])))) print("Women's visit rate: {:.2f}%".format(100 * (len(df[(df.visit == 1) & (df.segment == 'Womens E-Mail')]) / len(df[df.segment == 'Womens E-Mail'])))) print('Control visit rate: {:.2f}%'.format(100 * (len(df[(df.visit == 1) & (df.segment == 'No E-Mail')]) / len(df[df.segment == 'No E-Mail'])))) def spend_per_head(df): print("Men's mean spend: ${:.2f}".format(df[df.segment == 'Mens E-Mail'].spend.mean())) print("Women's mean spend: ${:.2f}".format(df[df.segment == 'Womens E-Mail'].spend.mean())) print('Control mean spend: ${:.2f}'.format(df[df.segment == 'No E-Mail'].spend.mean()))
__all__ = [ 'provider', 'songObj', 'spotifyClient', 'utils' ] #! You should be able to do all you want with just theese three lines #! from spotdl.search.spotifyClient import initialize #! from spotdl.search.songObj import songObj #! from spotdl.search.utils import *
__all__ = ['provider', 'songObj', 'spotifyClient', 'utils']
class Registry: def __init__(self, name): self._name = name self._registry_dict = dict() def register(self, name=None, obj=None): if obj is not None: if name is None: name = obj.__name__ return self._register(obj, name) return self._decorate(name) def get(self, name): if name not in self._registry_dict: self._key_not_found(name) return self._registry_dict[name] def _register(self, obj, name): if name in self._registry_dict: raise KeyError("{} is already registered in {}".format(name, self._name)) self._registry_dict[name] = obj def _decorate(self, name=None): def wrap(obj): cls_name = name if cls_name is None: cls_name = obj.__name__ self._register(obj, cls_name) return obj return wrap def _key_not_found(self, name): raise KeyError("{} is unknown type of {} ".format(name, self._name)) @property def registry_dict(self): return self._registry_dict
class Registry: def __init__(self, name): self._name = name self._registry_dict = dict() def register(self, name=None, obj=None): if obj is not None: if name is None: name = obj.__name__ return self._register(obj, name) return self._decorate(name) def get(self, name): if name not in self._registry_dict: self._key_not_found(name) return self._registry_dict[name] def _register(self, obj, name): if name in self._registry_dict: raise key_error('{} is already registered in {}'.format(name, self._name)) self._registry_dict[name] = obj def _decorate(self, name=None): def wrap(obj): cls_name = name if cls_name is None: cls_name = obj.__name__ self._register(obj, cls_name) return obj return wrap def _key_not_found(self, name): raise key_error('{} is unknown type of {} '.format(name, self._name)) @property def registry_dict(self): return self._registry_dict
def dobro(n): return n * 2 def metade(n): return n / 2 def aumentar(n): return n + (10 / 100 * n) def diminuir(n): return n - (13 / 100 * n)
def dobro(n): return n * 2 def metade(n): return n / 2 def aumentar(n): return n + 10 / 100 * n def diminuir(n): return n - 13 / 100 * n
g = [ (['p'],[('cat','wff')]), (['q'],[('cat','wff')]), (['r'],[('cat','wff')]), (['s'],[('cat','wff')]), (['t'],[('cat','wff')]), (['not'],[('sel','wff'),('cat','wff')]), (['and'],[('sel','wff'),('sel','wff'),('cat','wff')]), (['or'],[('sel','wff'),('sel','wff'),('cat','wff')]), (['implies'],[('sel','wff'),('sel','wff'),('cat','wff')]) ]
g = [(['p'], [('cat', 'wff')]), (['q'], [('cat', 'wff')]), (['r'], [('cat', 'wff')]), (['s'], [('cat', 'wff')]), (['t'], [('cat', 'wff')]), (['not'], [('sel', 'wff'), ('cat', 'wff')]), (['and'], [('sel', 'wff'), ('sel', 'wff'), ('cat', 'wff')]), (['or'], [('sel', 'wff'), ('sel', 'wff'), ('cat', 'wff')]), (['implies'], [('sel', 'wff'), ('sel', 'wff'), ('cat', 'wff')])]
def f(n, c=1): print(c) if c == n: return c f(n, c+1) f(12)
def f(n, c=1): print(c) if c == n: return c f(n, c + 1) f(12)
nop = b'\x00\x00' brk = b'\x00\xA0' lde = b'\x63\x07' # Load 0x07 (character 'a') into register V3 skp = b'\xE3\xA1' # Skip next instruction if user is NOT pressing character held in V3 with open("sknpvxtest.bin", 'wb') as f: f.write(lde) # 0x0200 <-- Load the byte 0x07 into register V3 f.write(brk) # 0x0202 <-- Wait here until we receive the go signal (we should get some characters on the mockinput pipe before here) f.write(skp) # 0x0204 <-- Now we should read the input pipe and check it for 'a' f.write(brk) # 0x0206 <-- If it worked, we should skip this breakpoint. f.write(nop) # 0x0208 <-- NOP a few times for good measure... f.write(nop) # 0x020A f.write(brk) # 0x020C <-- Stop here until we check the PC (which should be here, not at 0x0206) and get a character over the pipe. f.write(skp) # 0x020E <-- Now we should read the input pipe and check it for 'a' f.write(brk) # 0x0210 <-- If it worked, we should break here. f.write(brk) # 0x0212 <-- If it didn't work, we will break here... or at one of the following breakpoints. f.write(brk) # 0x0214 f.write(brk) # 0x0216
nop = b'\x00\x00' brk = b'\x00\xa0' lde = b'c\x07' skp = b'\xe3\xa1' with open('sknpvxtest.bin', 'wb') as f: f.write(lde) f.write(brk) f.write(skp) f.write(brk) f.write(nop) f.write(nop) f.write(brk) f.write(skp) f.write(brk) f.write(brk) f.write(brk) f.write(brk)
load("@bazel_skylib//rules:run_binary.bzl", "run_binary") load("@rules_cc//cc:defs.bzl", "cc_library") def rust_cxx_bridge(name, src, deps = []): native.alias( name = "%s/header" % name, actual = src + ".h", ) native.alias( name = "%s/source" % name, actual = src + ".cc", ) run_binary( name = "%s/generated" % name, srcs = [src], outs = [ src + ".h", src + ".cc", ], args = [ "$(location %s)" % src, "-o", "$(location %s.h)" % src, "-o", "$(location %s.cc)" % src, ], tool = "//:codegen", ) cc_library( name = name, srcs = [src + ".cc"], deps = deps + [":%s/include" % name], ) cc_library( name = "%s/include" % name, hdrs = [src + ".h"], )
load('@bazel_skylib//rules:run_binary.bzl', 'run_binary') load('@rules_cc//cc:defs.bzl', 'cc_library') def rust_cxx_bridge(name, src, deps=[]): native.alias(name='%s/header' % name, actual=src + '.h') native.alias(name='%s/source' % name, actual=src + '.cc') run_binary(name='%s/generated' % name, srcs=[src], outs=[src + '.h', src + '.cc'], args=['$(location %s)' % src, '-o', '$(location %s.h)' % src, '-o', '$(location %s.cc)' % src], tool='//:codegen') cc_library(name=name, srcs=[src + '.cc'], deps=deps + [':%s/include' % name]) cc_library(name='%s/include' % name, hdrs=[src + '.h'])
# Miho Damage Skin success = sm.addDamageSkin(2436044) if success: sm.chat("The Miho Damage Skin has been added to your account's damage skin collection.") sm.consumeItem(2436044)
success = sm.addDamageSkin(2436044) if success: sm.chat("The Miho Damage Skin has been added to your account's damage skin collection.") sm.consumeItem(2436044)
DOCKER_IMAGES = { "cpu": { "tensorflow": "ritazh/azk8sml-tensorflow:latest", }, "gpu": { "tensorflow": "ritazh/azk8sml-tensorflow:latest-gpu", } } DEFAULT_DOCKER_IMAGE = "ritazh/azk8sml-tensorflow:latest" DEFAULT_ARCH = "cpu"
docker_images = {'cpu': {'tensorflow': 'ritazh/azk8sml-tensorflow:latest'}, 'gpu': {'tensorflow': 'ritazh/azk8sml-tensorflow:latest-gpu'}} default_docker_image = 'ritazh/azk8sml-tensorflow:latest' default_arch = 'cpu'
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you 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. Test.Summary = ''' Test remap_stats plugin ''' # Skip if plugins not present. Test.SkipUnless(Condition.PluginExists('remap_stats.so')) Test.SkipIf(Condition.true("Test cannot deterministically wait until the stats appear")) server = Test.MakeOriginServer("server") request_header = { "headers": "GET /argh HTTP/1.1\r\nHost: one\r\n\r\n", "timestamp": "1469733493.993", "body": ""} response_header = {"headers": "HTTP/1.1 200 OK\r\nConnection: close\r\n\r\n", "timestamp": "1469733493.993", "body": ""} server.addResponse("sessionlog.json", request_header, response_header) ts = Test.MakeATSProcess("ts", command="traffic_manager", select_ports=True) ts.Disk.plugin_config.AddLine('remap_stats.so') ts.Disk.remap_config.AddLine( "map http://one http://127.0.0.1:{0}".format(server.Variables.Port) ) ts.Disk.remap_config.AddLine( "map http://two http://127.0.0.1:{0}".format(server.Variables.Port) ) ts.Disk.records_config.update({ 'proxy.config.http.transaction_active_timeout_out': 2, 'proxy.config.http.transaction_no_activity_timeout_out': 2, 'proxy.config.http.connect_attempts_timeout': 2, }) # 0 Test - Curl host One tr = Test.AddTestRun("curl host one") tr.Processes.Default.StartBefore(server) tr.Processes.Default.StartBefore(Test.Processes.ts) tr.Processes.Default.Command = 'curl -o /dev/null -H "Host: one"' + ' http://127.0.0.1:{}/argh'.format(ts.Variables.port) tr.Processes.Default.ReturnCode = 0 tr.StillRunningAfter = ts tr.StillRunningAfter = server # 1 Test - Curl host Two tr = Test.AddTestRun("curl host two") tr.Processes.Default.Command = 'curl -o /dev/null -H "Host: two"' + ' http://127.0.0.1:{}/badpath'.format(ts.Variables.port) tr.Processes.Default.ReturnCode = 0 tr.StillRunningAfter = ts tr.StillRunningAfter = server # 2 Test - Gather output tr = Test.AddTestRun("analyze stats") tr.Processes.Default.Command = r'traffic_ctl metric match \.\*remap_stats\*' tr.Processes.Default.Env = ts.Env tr.Processes.Default.ReturnCode = 0 tr.Processes.Default.TimeOut = 5 tr.DelayStart = 15 tr.TimeOut = 5 tr.Processes.Default.Streams.stdout = Testers.ContainsExpression( "plugin.remap_stats.one.status_2xx 1", "expected 2xx on first remap") tr.Processes.Default.Streams.stdout += Testers.ContainsExpression( "plugin.remap_stats.two.status_4xx 1", "expected 4xx on second remap")
Test.Summary = '\nTest remap_stats plugin\n' Test.SkipUnless(Condition.PluginExists('remap_stats.so')) Test.SkipIf(Condition.true('Test cannot deterministically wait until the stats appear')) server = Test.MakeOriginServer('server') request_header = {'headers': 'GET /argh HTTP/1.1\r\nHost: one\r\n\r\n', 'timestamp': '1469733493.993', 'body': ''} response_header = {'headers': 'HTTP/1.1 200 OK\r\nConnection: close\r\n\r\n', 'timestamp': '1469733493.993', 'body': ''} server.addResponse('sessionlog.json', request_header, response_header) ts = Test.MakeATSProcess('ts', command='traffic_manager', select_ports=True) ts.Disk.plugin_config.AddLine('remap_stats.so') ts.Disk.remap_config.AddLine('map http://one http://127.0.0.1:{0}'.format(server.Variables.Port)) ts.Disk.remap_config.AddLine('map http://two http://127.0.0.1:{0}'.format(server.Variables.Port)) ts.Disk.records_config.update({'proxy.config.http.transaction_active_timeout_out': 2, 'proxy.config.http.transaction_no_activity_timeout_out': 2, 'proxy.config.http.connect_attempts_timeout': 2}) tr = Test.AddTestRun('curl host one') tr.Processes.Default.StartBefore(server) tr.Processes.Default.StartBefore(Test.Processes.ts) tr.Processes.Default.Command = 'curl -o /dev/null -H "Host: one"' + ' http://127.0.0.1:{}/argh'.format(ts.Variables.port) tr.Processes.Default.ReturnCode = 0 tr.StillRunningAfter = ts tr.StillRunningAfter = server tr = Test.AddTestRun('curl host two') tr.Processes.Default.Command = 'curl -o /dev/null -H "Host: two"' + ' http://127.0.0.1:{}/badpath'.format(ts.Variables.port) tr.Processes.Default.ReturnCode = 0 tr.StillRunningAfter = ts tr.StillRunningAfter = server tr = Test.AddTestRun('analyze stats') tr.Processes.Default.Command = 'traffic_ctl metric match \\.\\*remap_stats\\*' tr.Processes.Default.Env = ts.Env tr.Processes.Default.ReturnCode = 0 tr.Processes.Default.TimeOut = 5 tr.DelayStart = 15 tr.TimeOut = 5 tr.Processes.Default.Streams.stdout = Testers.ContainsExpression('plugin.remap_stats.one.status_2xx 1', 'expected 2xx on first remap') tr.Processes.Default.Streams.stdout += Testers.ContainsExpression('plugin.remap_stats.two.status_4xx 1', 'expected 4xx on second remap')
# This file has automatically been generated # biogeme 2.6a [Mon May 14 17:32:05 EDT 2018] # <a href='http://people.epfl.ch/michel.bierlaire'>Michel Bierlaire</a>, <a href='http://transp-or.epfl.ch'>Transport and Mobility Laboratory</a>, <a href='http://www.epfl.ch'>Ecole Polytechnique F&eacute;d&eacute;rale de Lausanne (EPFL)</a> # Mon Jun 4 13:57:03 2018</p> # ASC_CAR = Beta('ASC_CAR',-1.64275,-10,10,0,'Car cte.' ) B_COST = Beta('B_COST',-0.180929,-10,10,0,'Travel cost' ) B_TIME = Beta('B_TIME',-0.0232704,-10,10,0,'Travel time' ) B_RELIB = Beta('B_RELIB',0.0860714,-10,10,0,'Travel reliability' ) ASC_CARRENTAL = Beta('ASC_CARRENTAL',-3.43973,-10,10,0,'Car Rental cte.' ) ASC_BUS = Beta('ASC_BUS',-2.875,-10,10,0,'Bus cte.' ) ASC_PLANE = Beta('ASC_PLANE',-2.36068,-10,10,0,'Plane cte.' ) ASC_TRAIN = Beta('ASC_TRAIN',-2.0106,-10,10,0,'Train cte.' ) ASC_TRH = Beta('ASC_TRH',0,-10,10,1,'TrH cte.' ) ## Code for the sensitivity analysis names = ['ASC_BUS','ASC_CAR','ASC_CARRENTAL','ASC_PLANE','ASC_TRAIN','B_COST','B_RELIB','B_TIME'] values = [[0.0222299,0.00778935,0.00263632,-0.000888164,0.00902636,0.0024049,0.0105436,-4.32583e-05],[0.00778935,0.0199112,0.0178978,0.0215904,0.0071847,-7.05174e-05,0.00508875,0.000675359],[0.00263632,0.0178978,0.0491379,0.0305725,0.003541,-0.00235489,0.00445526,0.000886736],[-0.000888164,0.0215904,0.0305725,0.0530497,0.00189364,-0.0043733,0.00427259,0.0012203],[0.00902636,0.0071847,0.003541,0.00189364,0.0169265,0.00171577,0.00605909,5.53087e-05],[0.0024049,-7.05174e-05,-0.00235489,-0.0043733,0.00171577,0.00113907,-0.000122535,-9.52213e-05],[0.0105436,0.00508875,0.00445526,0.00427259,0.00605909,-0.000122535,0.0223307,-7.38437e-05],[-4.32583e-05,0.000675359,0.000886736,0.0012203,5.53087e-05,-9.52213e-05,-7.38437e-05,3.91556e-05]] vc = bioMatrix(8,names,values) BIOGEME_OBJECT.VARCOVAR = vc
asc_car = beta('ASC_CAR', -1.64275, -10, 10, 0, 'Car cte.') b_cost = beta('B_COST', -0.180929, -10, 10, 0, 'Travel cost') b_time = beta('B_TIME', -0.0232704, -10, 10, 0, 'Travel time') b_relib = beta('B_RELIB', 0.0860714, -10, 10, 0, 'Travel reliability') asc_carrental = beta('ASC_CARRENTAL', -3.43973, -10, 10, 0, 'Car Rental cte.') asc_bus = beta('ASC_BUS', -2.875, -10, 10, 0, 'Bus cte.') asc_plane = beta('ASC_PLANE', -2.36068, -10, 10, 0, 'Plane cte.') asc_train = beta('ASC_TRAIN', -2.0106, -10, 10, 0, 'Train cte.') asc_trh = beta('ASC_TRH', 0, -10, 10, 1, 'TrH cte.') names = ['ASC_BUS', 'ASC_CAR', 'ASC_CARRENTAL', 'ASC_PLANE', 'ASC_TRAIN', 'B_COST', 'B_RELIB', 'B_TIME'] values = [[0.0222299, 0.00778935, 0.00263632, -0.000888164, 0.00902636, 0.0024049, 0.0105436, -4.32583e-05], [0.00778935, 0.0199112, 0.0178978, 0.0215904, 0.0071847, -7.05174e-05, 0.00508875, 0.000675359], [0.00263632, 0.0178978, 0.0491379, 0.0305725, 0.003541, -0.00235489, 0.00445526, 0.000886736], [-0.000888164, 0.0215904, 0.0305725, 0.0530497, 0.00189364, -0.0043733, 0.00427259, 0.0012203], [0.00902636, 0.0071847, 0.003541, 0.00189364, 0.0169265, 0.00171577, 0.00605909, 5.53087e-05], [0.0024049, -7.05174e-05, -0.00235489, -0.0043733, 0.00171577, 0.00113907, -0.000122535, -9.52213e-05], [0.0105436, 0.00508875, 0.00445526, 0.00427259, 0.00605909, -0.000122535, 0.0223307, -7.38437e-05], [-4.32583e-05, 0.000675359, 0.000886736, 0.0012203, 5.53087e-05, -9.52213e-05, -7.38437e-05, 3.91556e-05]] vc = bio_matrix(8, names, values) BIOGEME_OBJECT.VARCOVAR = vc
def longest_palindromic_substring_DP(s): S = [[False for i in range(len(s))] for j in range(len(s))] max_palindrome = "" for i in range(len(s))[::-1]: for j in range(i, len(s)): S[i][j] = s[i] == s[j] and (j - i < 3 or S[i+1][j-1]) if S[i][j] and j - i + 1 > len(max_palindrome): max_palindrome = s[i:j+1] return max_palindrome def longest_palindromic_substring_expansion(s): max_palindrome = "" for i in range(len(s) * 2 - 1): if i % 2 == 0: o = 0 ind = i // 2 while ind + o < len(s) and ind - o >= 0: if(s[ind + o] != s[ind - o]): break if ind + o - (ind - o) + 1 > len(max_palindrome): max_palindrome = s[ind-o:ind+o + 1] o += 1 else: o = 0 sind = i // 2 eind = i // 2 + 1 while sind - o >= 0 and eind + o < len(s): if(s[sind - o] != s[eind + o]): break if eind + o - (sind - o) + 1 > len(max_palindrome): max_palindrome = s[sind - o:eind + o + 1] o += 1 return max_palindrome input_string = "abbbacdcaacdca" ans_DP = longest_palindromic_substring_DP(input_string) ans_expansion = longest_palindromic_substring_expansion(input_string) print("DP Solution: {}, Expansion Solution: {}".format(ans_DP, ans_expansion))
def longest_palindromic_substring_dp(s): s = [[False for i in range(len(s))] for j in range(len(s))] max_palindrome = '' for i in range(len(s))[::-1]: for j in range(i, len(s)): S[i][j] = s[i] == s[j] and (j - i < 3 or S[i + 1][j - 1]) if S[i][j] and j - i + 1 > len(max_palindrome): max_palindrome = s[i:j + 1] return max_palindrome def longest_palindromic_substring_expansion(s): max_palindrome = '' for i in range(len(s) * 2 - 1): if i % 2 == 0: o = 0 ind = i // 2 while ind + o < len(s) and ind - o >= 0: if s[ind + o] != s[ind - o]: break if ind + o - (ind - o) + 1 > len(max_palindrome): max_palindrome = s[ind - o:ind + o + 1] o += 1 else: o = 0 sind = i // 2 eind = i // 2 + 1 while sind - o >= 0 and eind + o < len(s): if s[sind - o] != s[eind + o]: break if eind + o - (sind - o) + 1 > len(max_palindrome): max_palindrome = s[sind - o:eind + o + 1] o += 1 return max_palindrome input_string = 'abbbacdcaacdca' ans_dp = longest_palindromic_substring_dp(input_string) ans_expansion = longest_palindromic_substring_expansion(input_string) print('DP Solution: {}, Expansion Solution: {}'.format(ans_DP, ans_expansion))
class Solution: def nthUglyNumber(self, n): ugly = [1] i2 = i3 = i5 = 0 while len(ugly) < n: while ugly[i2] * 2 <= ugly[-1]: i2 += 1 while ugly[i3] * 3 <= ugly[-1]: i3 += 1 while ugly[i5] * 5 <= ugly[-1]: i5 += 1 ugly.append(min(ugly[i2] * 2, ugly[i3] * 3, ugly[i5] * 5)) return ugly[-1]
class Solution: def nth_ugly_number(self, n): ugly = [1] i2 = i3 = i5 = 0 while len(ugly) < n: while ugly[i2] * 2 <= ugly[-1]: i2 += 1 while ugly[i3] * 3 <= ugly[-1]: i3 += 1 while ugly[i5] * 5 <= ugly[-1]: i5 += 1 ugly.append(min(ugly[i2] * 2, ugly[i3] * 3, ugly[i5] * 5)) return ugly[-1]
def dividableNumberGenerator(limit, number): dividableNumbers = [] for i in range(0, limit, number): dividableNumbers.append(i) return dividableNumbers def sumDividableNumbers(dividableNumbers): sum = 0 for i in range(0, len(dividableNumbers)): sum += dividableNumbers[i] return sum print(sumDividableNumbers(dividableNumberGenerator(10000, 7) + dividableNumberGenerator(10000, 9)))
def dividable_number_generator(limit, number): dividable_numbers = [] for i in range(0, limit, number): dividableNumbers.append(i) return dividableNumbers def sum_dividable_numbers(dividableNumbers): sum = 0 for i in range(0, len(dividableNumbers)): sum += dividableNumbers[i] return sum print(sum_dividable_numbers(dividable_number_generator(10000, 7) + dividable_number_generator(10000, 9)))
( ((1,), (), ()), ((2,), (), ()), ((1, 2), (), ()), ((), (0,), ()), ((), (0,), (0,)), ((), (), ()), ((), (), ()), ((), (), ()), ((), (), ()), ((), (0,), (0,)), )
(((1,), (), ()), ((2,), (), ()), ((1, 2), (), ()), ((), (0,), ()), ((), (0,), (0,)), ((), (), ()), ((), (), ()), ((), (), ()), ((), (), ()), ((), (0,), (0,)))
class Solution: def __init__(self, w: List[int]): self.total = sum(w) for i in range(1, len(w)): w[i] += w[i-1] self.w = w def pickIndex(self) -> int: ans = 0 stop = randrange(self.total) l,r = 0, len(self.w)-1 while l <= r: mid = (l+r)//2 if self.w[mid] > stop: ans = mid r = mid-1 else: l = mid+1 return ans # Your Solution object will be instantiated and called as such: # obj = Solution(w) # param_1 = obj.pickIndex()
class Solution: def __init__(self, w: List[int]): self.total = sum(w) for i in range(1, len(w)): w[i] += w[i - 1] self.w = w def pick_index(self) -> int: ans = 0 stop = randrange(self.total) (l, r) = (0, len(self.w) - 1) while l <= r: mid = (l + r) // 2 if self.w[mid] > stop: ans = mid r = mid - 1 else: l = mid + 1 return ans
select_atom ={ 1: "H", 3: "Li", 6: "C", 7: "N", 8: "O", 9: "F", } select_weight ={ 1: 1.00794, 6: 12, 7: 15, 8: 16, 9: 18.998403, }
select_atom = {1: 'H', 3: 'Li', 6: 'C', 7: 'N', 8: 'O', 9: 'F'} select_weight = {1: 1.00794, 6: 12, 7: 15, 8: 16, 9: 18.998403}
config = dict({ "LunarLander-v2": { "DQN": { "eff_batch_size" : 128, "eps_decay" : 0.99, "gamma" : 0.99, "tau" : 0.005, "lr" : 0.0005 }, "EnsembleDQN": { "eff_batch_size" : 64, "eps_decay" : 0.99, "gamma" : 0.99, "tau" : 0.005, "lr" : 0.0005 }, "BootstrapDQN":{ "eff_batch_size" : 64, "eps_decay" : 0.99, "gamma" : 0.99, "tau" : 0.005, "lr" : 0.0005, "mask" : "bernoulli", "mask_prob" : 0.9, "prior_scale" : 10 }, "ProbDQN":{ "eff_batch_size" : 256, "eps_decay" : 0.991, "gamma" : 0.99, "tau" : 0.001, "lr" : 0.0005, "loss_att_weight" : 2 }, "IV_EnsembleDQN": { "eff_batch_size" : 64, "eps_decay" : 0.99, "gamma" : 0.99, "tau" : 0.005, "lr" : 0.0005, "dynamic_eps" : True, "minimal_eff_bs" : 48, }, "IV_BootstrapDQN":{ "eff_batch_size" : 64, "eps_decay" : 0.99, "gamma" : 0.99, "tau" : 0.005, "lr" : 0.0005, "dynamic_eps" : True, "mask" : "bernoulli", "mask_prob" : 0.5, "minimal_eff_bs" : 48, "prior_scale" : 0.1 }, "IV_ProbEnsembleDQN":{ "eff_batch_size" : 64, "eps_decay" : 0.99, "gamma" : 0.99, "tau" : 0.005, "lr" : 0.001, "eps" : 10, "loss_att_weight" : 3 }, "IV_ProbDQN":{ "eff_batch_size" : 256, "eps_decay" : 0.991, "gamma" : 0.99, "tau" : 0.001, "lr" : 0.0005, "loss_att_weight" : 2, "dynamic_eps" : True, "minimal_eff_bs" : 208 } }, "MountainCar-v0":{ "DQN":{ "eff_batch_size" : 256, "lr" : 0.001, "eps_decay" : 0.98, "tau" : 0.01 }, "BootstrapDQN":{ "eff_batch_size" : 256, "lr" : 0.001, "eps_decay" : 0.98, "tau" : 0.05, "mask_prob" : 0.5, "prior_scale" : 10 }, "SunriseDQN":{ "eff_batch_size" : 256, "lr" : 0.001, "eps_decay" : 0.98, "tau" : 0.05, "mask_prob" : 0.5, "prior_scale" : 10, "sunrise_temp" : 50 }, "IV_DQN":{ "eff_batch_size" : 256, "lr" : 0.001, "eps_decay" : 0.98, "tau" : 0.05, "mask_prob" : 0.5, "prior_scale" : 10, "eps" : 1000 }, "IV_ProbEnsembleDQN":{ "eff_batch_size" : 256, "lr" : 0.001, "eps_decay" : 0.98, "tau" : 0.05, "mask_prob" : 0.5, "prior_scale" : 10, "eps" : 1000 }, }, "gym_cheetah":{ "EnsembleSAC":{ "eff_batch_size" : 1024, "mask_prob" : 0.9, "ucb_lambda" : 0 }, "IV_EnsembleSAC":{ "eff_batch_size" : 1024, "mask_prob" : 0.9, "ucb_lambda" : 10, "minimal_eff_bs_ratio" : 0.99, "dynamic_eps" : True }, "IV_ProbEnsembleSAC":{ "eff_batch_size" : 1024, "mask_prob" : 1, "ucb_lambda" : 0, "minimal_eff_bs_ratio" : 0.99, "dynamic_eps" : True, "loss_att_weight" : 2 }, "IV_SAC":{ "eff_batch_size" : 1024, "mask_prob" : 1, "ucb_lambda" : 0, "minimal_eff_bs_ratio" : 0.99, "dynamic_eps" : True, "loss_att_weight" : 2 }, "IV_ProbSAC":{ "loss_att_weight" : 5, "minimal_eff_bs_ratio" : 0.5 } }, "gym_walker2d":{ "EnsembleSAC":{ "eff_batch_size" : 512, "mask_prob" : 1, "ucb_lambda" : 1 }, "IV_EnsembleSAC":{ "eff_batch_size" : 1024, "mask_prob" : 0.9, "ucb_lambda" : 10, "minimal_eff_bs_ratio" : 0.8, "dynamic_eps" : True }, "IV_ProbEnsembleSAC":{ "eff_batch_size" : 1024, "mask_prob" : 0.9, "ucb_lambda" : 10, "minimal_eff_bs_ratio" : 0.8, "dynamic_eps" : True, "loss_att_weight" : 5 }, "IV_SAC":{ "eff_batch_size" : 1024, "mask_prob" : 0.9, "ucb_lambda" : 10, "minimal_eff_bs_ratio" : 0.8, "dynamic_eps" : True, "loss_att_weight" : 5 }, }, "gym_hopper":{ "EnsembleSAC":{ "eff_batch_size" : 512, "mask_prob" : 1, "ucb_lambda" : 10 }, "IV_ProbEnsembleSAC":{ "eff_batch_size" : 1024, "mask_prob" : 0.7, "ucb_lambda" : 10, "minimal_eff_bs_ratio" : 0.8, "dynamic_eps" : True, "loss_att_weight" : 10 }, "IV_SAC":{ "eff_batch_size" : 1024, "mask_prob" : 0.7, "ucb_lambda" : 10, "minimal_eff_bs_ratio" : 0.8, "dynamic_eps" : True, "loss_att_weight" : 10 }, }, "gym_ant":{ "EnsembleSAC":{ "eff_batch_size" : 512, "mask_prob" : 0.9, "ucb_lambda" : 10 }, "IV_ProbEnsembleSAC":{ "eff_batch_size" : 1024, "mask_prob" : 1, "ucb_lambda" : 1, "minimal_eff_bs_ratio" : 0.9, "dynamic_eps" : True, "loss_att_weight" : 5 }, "IV_SAC":{ "eff_batch_size" : 1024, "mask_prob" : 1, "ucb_lambda" : 1, "minimal_eff_bs_ratio" : 0.9, "dynamic_eps" : True, "loss_att_weight" : 5 }, }, "cartpole":{ "BootstrapDQN":{ "batch_size" : 128, "mask_prob" : 5 }, "IV_BootstrapDQN":{ "batch_size" : 128, "mask_prob" : 0.5, "minimal_eff_bs_ratio" : 0.99 }, "IV_ProbEnsembleDQN":{ "batch_size" : 128, "mask_prob" : 0.5, "minimal_eff_bs_ratio" : 0.99, "loss_att_weight" : 10 }, "IV_BootstrapDQN":{ "batch_size" : 128, "mask_prob" : 0.5, "minimal_eff_bs_ratio" : 0.99, }, "IV_ProbDQN": { "loss_att_weight" : 0.1, "minimal_eff_bs_ratio" : 0.7 }, "ProbEnsembleDQN":{ "batch_size" : 128, "loss_att_weight" : 10, "mask_prob" : 0.5 } } })
config = dict({'LunarLander-v2': {'DQN': {'eff_batch_size': 128, 'eps_decay': 0.99, 'gamma': 0.99, 'tau': 0.005, 'lr': 0.0005}, 'EnsembleDQN': {'eff_batch_size': 64, 'eps_decay': 0.99, 'gamma': 0.99, 'tau': 0.005, 'lr': 0.0005}, 'BootstrapDQN': {'eff_batch_size': 64, 'eps_decay': 0.99, 'gamma': 0.99, 'tau': 0.005, 'lr': 0.0005, 'mask': 'bernoulli', 'mask_prob': 0.9, 'prior_scale': 10}, 'ProbDQN': {'eff_batch_size': 256, 'eps_decay': 0.991, 'gamma': 0.99, 'tau': 0.001, 'lr': 0.0005, 'loss_att_weight': 2}, 'IV_EnsembleDQN': {'eff_batch_size': 64, 'eps_decay': 0.99, 'gamma': 0.99, 'tau': 0.005, 'lr': 0.0005, 'dynamic_eps': True, 'minimal_eff_bs': 48}, 'IV_BootstrapDQN': {'eff_batch_size': 64, 'eps_decay': 0.99, 'gamma': 0.99, 'tau': 0.005, 'lr': 0.0005, 'dynamic_eps': True, 'mask': 'bernoulli', 'mask_prob': 0.5, 'minimal_eff_bs': 48, 'prior_scale': 0.1}, 'IV_ProbEnsembleDQN': {'eff_batch_size': 64, 'eps_decay': 0.99, 'gamma': 0.99, 'tau': 0.005, 'lr': 0.001, 'eps': 10, 'loss_att_weight': 3}, 'IV_ProbDQN': {'eff_batch_size': 256, 'eps_decay': 0.991, 'gamma': 0.99, 'tau': 0.001, 'lr': 0.0005, 'loss_att_weight': 2, 'dynamic_eps': True, 'minimal_eff_bs': 208}}, 'MountainCar-v0': {'DQN': {'eff_batch_size': 256, 'lr': 0.001, 'eps_decay': 0.98, 'tau': 0.01}, 'BootstrapDQN': {'eff_batch_size': 256, 'lr': 0.001, 'eps_decay': 0.98, 'tau': 0.05, 'mask_prob': 0.5, 'prior_scale': 10}, 'SunriseDQN': {'eff_batch_size': 256, 'lr': 0.001, 'eps_decay': 0.98, 'tau': 0.05, 'mask_prob': 0.5, 'prior_scale': 10, 'sunrise_temp': 50}, 'IV_DQN': {'eff_batch_size': 256, 'lr': 0.001, 'eps_decay': 0.98, 'tau': 0.05, 'mask_prob': 0.5, 'prior_scale': 10, 'eps': 1000}, 'IV_ProbEnsembleDQN': {'eff_batch_size': 256, 'lr': 0.001, 'eps_decay': 0.98, 'tau': 0.05, 'mask_prob': 0.5, 'prior_scale': 10, 'eps': 1000}}, 'gym_cheetah': {'EnsembleSAC': {'eff_batch_size': 1024, 'mask_prob': 0.9, 'ucb_lambda': 0}, 'IV_EnsembleSAC': {'eff_batch_size': 1024, 'mask_prob': 0.9, 'ucb_lambda': 10, 'minimal_eff_bs_ratio': 0.99, 'dynamic_eps': True}, 'IV_ProbEnsembleSAC': {'eff_batch_size': 1024, 'mask_prob': 1, 'ucb_lambda': 0, 'minimal_eff_bs_ratio': 0.99, 'dynamic_eps': True, 'loss_att_weight': 2}, 'IV_SAC': {'eff_batch_size': 1024, 'mask_prob': 1, 'ucb_lambda': 0, 'minimal_eff_bs_ratio': 0.99, 'dynamic_eps': True, 'loss_att_weight': 2}, 'IV_ProbSAC': {'loss_att_weight': 5, 'minimal_eff_bs_ratio': 0.5}}, 'gym_walker2d': {'EnsembleSAC': {'eff_batch_size': 512, 'mask_prob': 1, 'ucb_lambda': 1}, 'IV_EnsembleSAC': {'eff_batch_size': 1024, 'mask_prob': 0.9, 'ucb_lambda': 10, 'minimal_eff_bs_ratio': 0.8, 'dynamic_eps': True}, 'IV_ProbEnsembleSAC': {'eff_batch_size': 1024, 'mask_prob': 0.9, 'ucb_lambda': 10, 'minimal_eff_bs_ratio': 0.8, 'dynamic_eps': True, 'loss_att_weight': 5}, 'IV_SAC': {'eff_batch_size': 1024, 'mask_prob': 0.9, 'ucb_lambda': 10, 'minimal_eff_bs_ratio': 0.8, 'dynamic_eps': True, 'loss_att_weight': 5}}, 'gym_hopper': {'EnsembleSAC': {'eff_batch_size': 512, 'mask_prob': 1, 'ucb_lambda': 10}, 'IV_ProbEnsembleSAC': {'eff_batch_size': 1024, 'mask_prob': 0.7, 'ucb_lambda': 10, 'minimal_eff_bs_ratio': 0.8, 'dynamic_eps': True, 'loss_att_weight': 10}, 'IV_SAC': {'eff_batch_size': 1024, 'mask_prob': 0.7, 'ucb_lambda': 10, 'minimal_eff_bs_ratio': 0.8, 'dynamic_eps': True, 'loss_att_weight': 10}}, 'gym_ant': {'EnsembleSAC': {'eff_batch_size': 512, 'mask_prob': 0.9, 'ucb_lambda': 10}, 'IV_ProbEnsembleSAC': {'eff_batch_size': 1024, 'mask_prob': 1, 'ucb_lambda': 1, 'minimal_eff_bs_ratio': 0.9, 'dynamic_eps': True, 'loss_att_weight': 5}, 'IV_SAC': {'eff_batch_size': 1024, 'mask_prob': 1, 'ucb_lambda': 1, 'minimal_eff_bs_ratio': 0.9, 'dynamic_eps': True, 'loss_att_weight': 5}}, 'cartpole': {'BootstrapDQN': {'batch_size': 128, 'mask_prob': 5}, 'IV_BootstrapDQN': {'batch_size': 128, 'mask_prob': 0.5, 'minimal_eff_bs_ratio': 0.99}, 'IV_ProbEnsembleDQN': {'batch_size': 128, 'mask_prob': 0.5, 'minimal_eff_bs_ratio': 0.99, 'loss_att_weight': 10}, 'IV_BootstrapDQN': {'batch_size': 128, 'mask_prob': 0.5, 'minimal_eff_bs_ratio': 0.99}, 'IV_ProbDQN': {'loss_att_weight': 0.1, 'minimal_eff_bs_ratio': 0.7}, 'ProbEnsembleDQN': {'batch_size': 128, 'loss_att_weight': 10, 'mask_prob': 0.5}}})
season = str(input()) gender = str(input()) people = int(input()) time = int(input()) winter = False spring = False summer = False girls = False boys = False mixed = False tax = 0 sport = str() total_price = 0 discount = 0 if season == "Winter": winter = True elif season == "Spring": spring = True elif season == "Summer": summer = True if gender == "boys": boys = True elif gender == "girls": girls = True elif gender == "mixed": mixed = True if people >= 50: discount = 0.50 elif 20 <= people < 50: discount = 0.85 elif 10 <= people < 20: discount = 0.95 else: discount = 1 if winter: if boys or girls: tax = 9.60 total_price = people * tax if boys: sport = "Judo" if girls: sport = "Gymnastics" elif mixed: tax = 10 total_price = people * tax sport = "Ski" elif spring: if boys or girls: tax = 7.20 total_price = people * tax if boys: sport = "Tennis" if girls: sport = "Athletics" elif mixed: tax = 9.50 total_price = people * tax sport = "Cycling" elif summer: if boys or girls: tax = 15 total_price = people * tax if boys: sport = "Football" if girls: sport = "Volleyball" elif mixed: tax = 20 total_price = people * tax sport = "Swimming" print(f"{sport} {(total_price * time) * discount:.2f} lv. ")
season = str(input()) gender = str(input()) people = int(input()) time = int(input()) winter = False spring = False summer = False girls = False boys = False mixed = False tax = 0 sport = str() total_price = 0 discount = 0 if season == 'Winter': winter = True elif season == 'Spring': spring = True elif season == 'Summer': summer = True if gender == 'boys': boys = True elif gender == 'girls': girls = True elif gender == 'mixed': mixed = True if people >= 50: discount = 0.5 elif 20 <= people < 50: discount = 0.85 elif 10 <= people < 20: discount = 0.95 else: discount = 1 if winter: if boys or girls: tax = 9.6 total_price = people * tax if boys: sport = 'Judo' if girls: sport = 'Gymnastics' elif mixed: tax = 10 total_price = people * tax sport = 'Ski' elif spring: if boys or girls: tax = 7.2 total_price = people * tax if boys: sport = 'Tennis' if girls: sport = 'Athletics' elif mixed: tax = 9.5 total_price = people * tax sport = 'Cycling' elif summer: if boys or girls: tax = 15 total_price = people * tax if boys: sport = 'Football' if girls: sport = 'Volleyball' elif mixed: tax = 20 total_price = people * tax sport = 'Swimming' print(f'{sport} {total_price * time * discount:.2f} lv. ')
work_hours = [('Abby',100),('Billy',400),('Cassie',800)] def employee_check(work_hours): current_max = 0 # Set some empty value before the loop employee_of_month = '' for employee,hours in work_hours: if hours > current_max: current_max = hours employee_of_month = employee else: pass # Notice the indentation here return (employee_of_month,current_max) print(employee_check(work_hours))
work_hours = [('Abby', 100), ('Billy', 400), ('Cassie', 800)] def employee_check(work_hours): current_max = 0 employee_of_month = '' for (employee, hours) in work_hours: if hours > current_max: current_max = hours employee_of_month = employee else: pass return (employee_of_month, current_max) print(employee_check(work_hours))
def row_sum_odd_numbers(n): row_first_odd = int(0.5*(n-1)*n) odd_list = range(1, (row_first_odd+n)*2, 2) odd_row = odd_list[row_first_odd:] return sum(odd_row) # Example: # 1 # 3 5 # 7 9 11 # 13 15 17 19 # 21 23 25 27 29 # row_sum_odd_numbers(1); # 1 # row_sum_odd_numbers(2); # 3 + 5 = 8 # print row_sum_odd_numbers(1) # print row_sum_odd_numbers(2) # print row_sum_odd_numbers(3) # print row_sum_odd_numbers(4)
def row_sum_odd_numbers(n): row_first_odd = int(0.5 * (n - 1) * n) odd_list = range(1, (row_first_odd + n) * 2, 2) odd_row = odd_list[row_first_odd:] return sum(odd_row)
# -*- coding: utf-8 -*- # Scrapy settings for Downloader project # # For simplicity, this file contains only the most important settings by # default. All the other settings are documented here: # # http://doc.scrapy.org/en/latest/topics/settings.html # BOT_NAME = 'CNSpider' SPIDER_MODULES = ['CNSpider.spiders'] NEWSPIDER_MODULE = 'CNSpider.spiders' RANDOMIZE_DOWNLOAD_DELAY = True #DOWNLOAD_DELAY = 1 COOKIES_ENABLED = False RETRY_ENABLED = False DOWNLOADER_MIDDLEWARES = { 'scrapy.contrib.downloadermiddleware.useragent.UserAgentMiddleware' : None, 'CNSpider.rotate_useragent.RotateUserAgentMiddleware' :400 } SPIDER_MIDDLEWARES = { 'scrapy.contrib.spidermiddleware.offsite.OffsiteMiddleware': 500, }
bot_name = 'CNSpider' spider_modules = ['CNSpider.spiders'] newspider_module = 'CNSpider.spiders' randomize_download_delay = True cookies_enabled = False retry_enabled = False downloader_middlewares = {'scrapy.contrib.downloadermiddleware.useragent.UserAgentMiddleware': None, 'CNSpider.rotate_useragent.RotateUserAgentMiddleware': 400} spider_middlewares = {'scrapy.contrib.spidermiddleware.offsite.OffsiteMiddleware': 500}
sequence = [1] n = 0 while n < 40: sequence.append(sequence[n] + sequence[n-1]) n += 1 print('The Fibonacci sequence, up to the 30th term, is \n' + str(sequence) + '.') pisano = input("Please pick a number. ") psequence = [] for item in sequence: psequence.append(item % pisano) print(psequence) # for item in sequence: # if item%pisano != 0: # psequence.append(item%pisano) # else: # print('The Pisano period of ' + str(pisano) + ' for the Fibonacci sequence is ' + str(psequence) + '.') # break
sequence = [1] n = 0 while n < 40: sequence.append(sequence[n] + sequence[n - 1]) n += 1 print('The Fibonacci sequence, up to the 30th term, is \n' + str(sequence) + '.') pisano = input('Please pick a number. ') psequence = [] for item in sequence: psequence.append(item % pisano) print(psequence)
class OperationHolderMixin: def __and__(self, other): return OperandHolder(AND, self, other) def __or__(self, other): return OperandHolder(OR, self, other) def __rand__(self, other): return OperandHolder(AND, other, self) def __ror__(self, other): return OperandHolder(OR, other, self) def __invert__(self): return SingleOperandHolder(NOT, self) class SingleOperandHolder(OperationHolderMixin): def __init__(self, operator_class, op1_class): self.operator_class = operator_class self.op1_class = op1_class def __call__(self, *args, **kwargs): op1 = self.op1_class(*args, **kwargs) return self.operator_class(op1) class OperandHolder(OperationHolderMixin): def __init__(self, operator_class, op1_class, op2_class): self.operator_class = operator_class self.op1_class = op1_class self.op2_class = op2_class def __call__(self, *args, **kwargs): op1 = self.op1_class(*args, **kwargs) op2 = self.op2_class(*args, **kwargs) return self.operator_class(op1, op2) class AND: def __init__(self, op1, op2): self.op1 = op1 self.op2 = op2 def has_permission(self, context): return ( self.op1.has_permission(context) and self.op2.has_permission(context) ) def has_object_permission(self, context, obj): return ( self.op1.has_object_permission(context, obj) and self.op2.has_object_permission(context, obj) ) class OR: def __init__(self, op1, op2): self.op1 = op1 self.op2 = op2 def has_permission(self, context): return ( self.op1.has_permission(context) or self.op2.has_permission(context) ) def has_object_permission(self, context, obj): return ( self.op1.has_object_permission(context, obj) or self.op2.has_object_permission(context, obj) ) class NOT: def __init__(self, op1): self.op1 = op1 def has_permission(self, context): return not self.op1.has_permission(context) def has_object_permission(self, context, obj): return not self.op1.has_object_permission(context, obj) class BasePermissionMetaclass(OperationHolderMixin, type): pass
class Operationholdermixin: def __and__(self, other): return operand_holder(AND, self, other) def __or__(self, other): return operand_holder(OR, self, other) def __rand__(self, other): return operand_holder(AND, other, self) def __ror__(self, other): return operand_holder(OR, other, self) def __invert__(self): return single_operand_holder(NOT, self) class Singleoperandholder(OperationHolderMixin): def __init__(self, operator_class, op1_class): self.operator_class = operator_class self.op1_class = op1_class def __call__(self, *args, **kwargs): op1 = self.op1_class(*args, **kwargs) return self.operator_class(op1) class Operandholder(OperationHolderMixin): def __init__(self, operator_class, op1_class, op2_class): self.operator_class = operator_class self.op1_class = op1_class self.op2_class = op2_class def __call__(self, *args, **kwargs): op1 = self.op1_class(*args, **kwargs) op2 = self.op2_class(*args, **kwargs) return self.operator_class(op1, op2) class And: def __init__(self, op1, op2): self.op1 = op1 self.op2 = op2 def has_permission(self, context): return self.op1.has_permission(context) and self.op2.has_permission(context) def has_object_permission(self, context, obj): return self.op1.has_object_permission(context, obj) and self.op2.has_object_permission(context, obj) class Or: def __init__(self, op1, op2): self.op1 = op1 self.op2 = op2 def has_permission(self, context): return self.op1.has_permission(context) or self.op2.has_permission(context) def has_object_permission(self, context, obj): return self.op1.has_object_permission(context, obj) or self.op2.has_object_permission(context, obj) class Not: def __init__(self, op1): self.op1 = op1 def has_permission(self, context): return not self.op1.has_permission(context) def has_object_permission(self, context, obj): return not self.op1.has_object_permission(context, obj) class Basepermissionmetaclass(OperationHolderMixin, type): pass
class InvalidBackend(Exception): pass class NodeDoesNotExist(Exception): pass class PersistenceError(Exception): pass
class Invalidbackend(Exception): pass class Nodedoesnotexist(Exception): pass class Persistenceerror(Exception): pass
# -*- coding: utf-8 -*- class WebsocketError: CodeInvalidSession = 9001 CodeConnCloseErr = 9005 class AuthenticationFailedError(RuntimeError): def __init__(self, msg): self.msgs = msg def __str__(self): return self.msgs class NotFoundError(RuntimeError): def __init__(self, msg): self.msgs = msg def __str__(self): return self.msgs class MethodNotAllowedError(RuntimeError): def __init__(self, msg): self.msgs = msg def __str__(self): return self.msgs class SequenceNumberError(RuntimeError): def __init__(self, msg): self.msgs = msg def __str__(self): return self.msgs class ServerError(RuntimeError): def __init__(self, msg): self.msgs = msg def __str__(self): return self.msgs
class Websocketerror: code_invalid_session = 9001 code_conn_close_err = 9005 class Authenticationfailederror(RuntimeError): def __init__(self, msg): self.msgs = msg def __str__(self): return self.msgs class Notfounderror(RuntimeError): def __init__(self, msg): self.msgs = msg def __str__(self): return self.msgs class Methodnotallowederror(RuntimeError): def __init__(self, msg): self.msgs = msg def __str__(self): return self.msgs class Sequencenumbererror(RuntimeError): def __init__(self, msg): self.msgs = msg def __str__(self): return self.msgs class Servererror(RuntimeError): def __init__(self, msg): self.msgs = msg def __str__(self): return self.msgs
# Problem: https://www.hackerrank.com/challenges/repeated-string/problem # Score: 20 def repeated_string(s, n): return n // len(s) * s.count('a') + s[0: n % len(s)].count('a') s = input() n = int(input()) print(repeated_string(s, n))
def repeated_string(s, n): return n // len(s) * s.count('a') + s[0:n % len(s)].count('a') s = input() n = int(input()) print(repeated_string(s, n))
num1 = int(input()) num2 = int(input()) if num1>=num2: print(num1) else: print(num2)
num1 = int(input()) num2 = int(input()) if num1 >= num2: print(num1) else: print(num2)
# -- Project information ----------------------------------------------------- project = 'LUNA' copyright = '2020 Great Scott Gadgets' author = 'Katherine J. Temkin' # -- General configuration --------------------------------------------------- master_doc = 'index' extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.napoleon' ] templates_path = ['_templates'] exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] # -- Options for HTML output ------------------------------------------------- html_theme = 'sphinx_rtd_theme' html_static_path = ['_static'] html_css_files = ['status.css'] # -- Options for automatic documentation ------------------------------------- # Skip documenting Tests. def autodoc_skip_member_handler(app, what, name, obj, skip, options): return \ name.endswith("Test") or \ name.startswith('_') or \ (name == "elaborate") def setup(app): app.connect('autodoc-skip-member', autodoc_skip_member_handler)
project = 'LUNA' copyright = '2020 Great Scott Gadgets' author = 'Katherine J. Temkin' master_doc = 'index' extensions = ['sphinx.ext.autodoc', 'sphinx.ext.napoleon'] templates_path = ['_templates'] exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] html_theme = 'sphinx_rtd_theme' html_static_path = ['_static'] html_css_files = ['status.css'] def autodoc_skip_member_handler(app, what, name, obj, skip, options): return name.endswith('Test') or name.startswith('_') or name == 'elaborate' def setup(app): app.connect('autodoc-skip-member', autodoc_skip_member_handler)
def sample_single_dim(action_space_list_each, is_act_continuous): each = [] if is_act_continuous: each = action_space_list_each.sample() else: if action_space_list_each.__class__.__name__ == "Discrete": each = [0] * action_space_list_each.n idx = action_space_list_each.sample() each[idx] = 1 elif action_space_list_each.__class__.__name__ == "MultiDiscreteParticle": each = [] nvec = action_space_list_each.high - action_space_list_each.low + 1 sample_indexes = action_space_list_each.sample() for i in range(len(nvec)): dim = nvec[i] new_action = [0] * dim index = sample_indexes[i] new_action[index] = 1 each.extend(new_action) return each def sample(action_space_list_each, is_act_continuous): player = [] if is_act_continuous: for j in range(len(action_space_list_each)): each = action_space_list_each[j].sample() player.append(each) else: player = [] for j in range(len(action_space_list_each)): # each = [0] * action_space_list_each[j] # idx = np.random.randint(action_space_list_each[j]) if action_space_list_each[j].__class__.__name__ == "Discrete": each = [0] * action_space_list_each[j].n idx = action_space_list_each[j].sample() each[idx] = 1 player.append(each) elif action_space_list_each[j].__class__.__name__ == "MultiDiscreteParticle": each = [] nvec = action_space_list_each[j].high sample_indexes = action_space_list_each[j].sample() for i in range(len(nvec)): dim = nvec[i] + 1 new_action = [0] * dim index = sample_indexes[i] new_action[index] = 1 each.extend(new_action) player.append(each) return player
def sample_single_dim(action_space_list_each, is_act_continuous): each = [] if is_act_continuous: each = action_space_list_each.sample() elif action_space_list_each.__class__.__name__ == 'Discrete': each = [0] * action_space_list_each.n idx = action_space_list_each.sample() each[idx] = 1 elif action_space_list_each.__class__.__name__ == 'MultiDiscreteParticle': each = [] nvec = action_space_list_each.high - action_space_list_each.low + 1 sample_indexes = action_space_list_each.sample() for i in range(len(nvec)): dim = nvec[i] new_action = [0] * dim index = sample_indexes[i] new_action[index] = 1 each.extend(new_action) return each def sample(action_space_list_each, is_act_continuous): player = [] if is_act_continuous: for j in range(len(action_space_list_each)): each = action_space_list_each[j].sample() player.append(each) else: player = [] for j in range(len(action_space_list_each)): if action_space_list_each[j].__class__.__name__ == 'Discrete': each = [0] * action_space_list_each[j].n idx = action_space_list_each[j].sample() each[idx] = 1 player.append(each) elif action_space_list_each[j].__class__.__name__ == 'MultiDiscreteParticle': each = [] nvec = action_space_list_each[j].high sample_indexes = action_space_list_each[j].sample() for i in range(len(nvec)): dim = nvec[i] + 1 new_action = [0] * dim index = sample_indexes[i] new_action[index] = 1 each.extend(new_action) player.append(each) return player
class Solution(object): def match_note_to_magazine(self, ransom_note, magazine): if ransom_note is None or magazine is None: raise TypeError('ransom_note or magazine cannot be None') seen_chars = {} for char in magazine: if char in seen_chars: seen_chars[char] += 1 else: seen_chars[char] = 1 for char in ransom_note: try: seen_chars[char] -= 1 except KeyError: return False if seen_chars[char] < 0: return False return True
class Solution(object): def match_note_to_magazine(self, ransom_note, magazine): if ransom_note is None or magazine is None: raise type_error('ransom_note or magazine cannot be None') seen_chars = {} for char in magazine: if char in seen_chars: seen_chars[char] += 1 else: seen_chars[char] = 1 for char in ransom_note: try: seen_chars[char] -= 1 except KeyError: return False if seen_chars[char] < 0: return False return True
def on_message_deleted(msg, server): return "Deleted: {}".format(msg["previous_message"]["text"]) def on_message_changed(msg, server): text = msg.get("message", {"text": ""}).get("text", "") if text.startswith("!echo"): return "Changed: {}".format(text) def on_message(msg, server): if msg["text"].startswith("!echo"): return msg.get("text", "") def on_channel_join(msg, server): return "saw user {} join".format(msg['user'])
def on_message_deleted(msg, server): return 'Deleted: {}'.format(msg['previous_message']['text']) def on_message_changed(msg, server): text = msg.get('message', {'text': ''}).get('text', '') if text.startswith('!echo'): return 'Changed: {}'.format(text) def on_message(msg, server): if msg['text'].startswith('!echo'): return msg.get('text', '') def on_channel_join(msg, server): return 'saw user {} join'.format(msg['user'])
# generated from genmsg/cmake/pkg-genmsg.context.in messages_str = "/home/hunter/github_projects/ROS/catkin_ws/src/my_package/msg/Num.msg" services_str = "/home/hunter/github_projects/ROS/catkin_ws/src/my_package/srv/AddTwoInts.srv" pkg_name = "my_package" dependencies_str = "std_msgs" langs = "gencpp;geneus;genlisp;gennodejs;genpy" dep_include_paths_str = "my_package;/home/hunter/github_projects/ROS/catkin_ws/src/my_package/msg;std_msgs;/opt/ros/kinetic/share/std_msgs/cmake/../msg" PYTHON_EXECUTABLE = "/usr/bin/python" package_has_static_sources = '' == 'TRUE' genmsg_check_deps_script = "/opt/ros/kinetic/share/genmsg/cmake/../../../lib/genmsg/genmsg_check_deps.py"
messages_str = '/home/hunter/github_projects/ROS/catkin_ws/src/my_package/msg/Num.msg' services_str = '/home/hunter/github_projects/ROS/catkin_ws/src/my_package/srv/AddTwoInts.srv' pkg_name = 'my_package' dependencies_str = 'std_msgs' langs = 'gencpp;geneus;genlisp;gennodejs;genpy' dep_include_paths_str = 'my_package;/home/hunter/github_projects/ROS/catkin_ws/src/my_package/msg;std_msgs;/opt/ros/kinetic/share/std_msgs/cmake/../msg' python_executable = '/usr/bin/python' package_has_static_sources = '' == 'TRUE' genmsg_check_deps_script = '/opt/ros/kinetic/share/genmsg/cmake/../../../lib/genmsg/genmsg_check_deps.py'
class FunctionDifferentialRegistry(dict): def __setitem__(self, k, v): if not callable(k): raise ValueError("key must be callable") if not callable(v): raise ValueError("value must be callable") super().__setitem__(k, v) global_registry = FunctionDifferentialRegistry() def diff(grad_f): def inner(f, registry=None): register_diff(f, grad_f, registry=registry) return f return inner def register_diff(f, grad_f, registry=None): if registry is None: registry = global_registry registry[f] = grad_f
class Functiondifferentialregistry(dict): def __setitem__(self, k, v): if not callable(k): raise value_error('key must be callable') if not callable(v): raise value_error('value must be callable') super().__setitem__(k, v) global_registry = function_differential_registry() def diff(grad_f): def inner(f, registry=None): register_diff(f, grad_f, registry=registry) return f return inner def register_diff(f, grad_f, registry=None): if registry is None: registry = global_registry registry[f] = grad_f
def timeconverter(days): years = days // 365 days = days % 365 months = days // 30 days = days % 30 print(f"{years} years, {months} months and {days} days") days = input("Enter number of days: ") days = int(days) timeconverter(days)
def timeconverter(days): years = days // 365 days = days % 365 months = days // 30 days = days % 30 print(f'{years} years, {months} months and {days} days') days = input('Enter number of days: ') days = int(days) timeconverter(days)
print("hello world") print("my name is mark zed bruyg") print("555") karachi_city = ["gulshan", "johar", "malir", "defence", "liyari"] print(karachi_city[2]) names_of_student = ["maaz", "musab", "usman", "shuraim", "sudais", "ausaf"] print(names_of_student) age = 12 amount_to_increment = 3 age += amount_to_increment print(age)
print('hello world') print('my name is mark zed bruyg') print('555') karachi_city = ['gulshan', 'johar', 'malir', 'defence', 'liyari'] print(karachi_city[2]) names_of_student = ['maaz', 'musab', 'usman', 'shuraim', 'sudais', 'ausaf'] print(names_of_student) age = 12 amount_to_increment = 3 age += amount_to_increment print(age)
# (raw name, table column) COLS=[ ('cxid', 'cxid'), ('dts', 'dts'), ('Existing Meter Number', 'old_meter_number'), ('Existing Meter Reading', 'old_meter_reading'), ('New Meter Number', 'new_meter_number'), ('New Meter Reading', 'new_meter_reading'), ('Geo Tag', 'geo_tag'), ('GPS', 'gps'), ('SRV Man Initials', 'initials'), ('Meter Site Insp.', 'insp_state'), ('Meter Site Insp. Notes', 'insp_notes'), # ('SO No', 'sono'), # ('Map No', 'mapno'), ('Photo1', 'photo1'), ('Photo2', 'photo2'), ('Photo3', 'photo3') ] DATA_FIELDS=[ 'cxid', 'old_meter_number', 'old_meter_reading', 'new_meter_number', 'new_meter_reading', 'dts' ] LOC_FIELDS=[ 'id', 'gps_x', 'gps_y', 'geo_tag' ] PHOTO_FIELDS=[ 'id', 'photo1', 'photo2', 'photo3' ] SITE_INSP_FIELDS=[ 'id', 'initials', 'insp_state', 'insp_notes' ] class RF_Changeout(): @staticmethod def from_row(row): self = RF_Changeout() for key, col in COLS: if key in row: setattr(self, col, row[key]) self.fix_gps() return self def __getitem__(self, key): return getattr(self, key, None) def __setitem__(self, key, value): return setattr(self, key, value) def fix_gps(self): gps = getattr(self, 'gps', None) if gps and not 'None' in gps: u, v = gps.replace(' ', '').split(',') if u and v: self.gps_y = float(u) # Latitude self.gps_x = float(v) # Longitude del self.gps def get_data(self): result=list() for field in DATA_FIELDS: result.append(self[field]) return result def get_loc(self): result=list() for field in LOC_FIELDS: result.append(self[field]) return result def get_photos(self): result=list() for field in PHOTO_FIELDS: result.append(self[field]) return result def get_site_insp(self): result=list() for field in SITE_INSP_FIELDS: result.append(self[field]) return result def collect_rows(row, data): oid = row['order_id'] key = row['data_point'] val = row['value'] if not oid in data: data[oid] = dict() data[oid]['dts'] = row['dts'] data[oid][key] = val
cols = [('cxid', 'cxid'), ('dts', 'dts'), ('Existing Meter Number', 'old_meter_number'), ('Existing Meter Reading', 'old_meter_reading'), ('New Meter Number', 'new_meter_number'), ('New Meter Reading', 'new_meter_reading'), ('Geo Tag', 'geo_tag'), ('GPS', 'gps'), ('SRV Man Initials', 'initials'), ('Meter Site Insp.', 'insp_state'), ('Meter Site Insp. Notes', 'insp_notes'), ('Photo1', 'photo1'), ('Photo2', 'photo2'), ('Photo3', 'photo3')] data_fields = ['cxid', 'old_meter_number', 'old_meter_reading', 'new_meter_number', 'new_meter_reading', 'dts'] loc_fields = ['id', 'gps_x', 'gps_y', 'geo_tag'] photo_fields = ['id', 'photo1', 'photo2', 'photo3'] site_insp_fields = ['id', 'initials', 'insp_state', 'insp_notes'] class Rf_Changeout: @staticmethod def from_row(row): self = rf__changeout() for (key, col) in COLS: if key in row: setattr(self, col, row[key]) self.fix_gps() return self def __getitem__(self, key): return getattr(self, key, None) def __setitem__(self, key, value): return setattr(self, key, value) def fix_gps(self): gps = getattr(self, 'gps', None) if gps and (not 'None' in gps): (u, v) = gps.replace(' ', '').split(',') if u and v: self.gps_y = float(u) self.gps_x = float(v) del self.gps def get_data(self): result = list() for field in DATA_FIELDS: result.append(self[field]) return result def get_loc(self): result = list() for field in LOC_FIELDS: result.append(self[field]) return result def get_photos(self): result = list() for field in PHOTO_FIELDS: result.append(self[field]) return result def get_site_insp(self): result = list() for field in SITE_INSP_FIELDS: result.append(self[field]) return result def collect_rows(row, data): oid = row['order_id'] key = row['data_point'] val = row['value'] if not oid in data: data[oid] = dict() data[oid]['dts'] = row['dts'] data[oid][key] = val
class Solution: def simplifyPath(self, path: str) -> str: stk = [] for p in path.split('/'): if p == '..': if stk: stk.pop() elif p and p != '.': stk.append(p) return '/' + '/'.join(stk)
class Solution: def simplify_path(self, path: str) -> str: stk = [] for p in path.split('/'): if p == '..': if stk: stk.pop() elif p and p != '.': stk.append(p) return '/' + '/'.join(stk)
class Fraction(object): def __init__(self, num, den): self.__num = num self.__den = den self.reduce() def __str__(self): return "%d/%d" % (self.__num, self.__den) def __invert__(self): return Fraction(self.__den,self.__num) def __neg__(self): return Fraction(-(self.__num), self.__den) def __pow__(self, pow): return Fraction(self.__num **pow,self.__den**pow) def __float__(self): return float(self.__num/self.__den) def __int__(self): return int(self.__num/self.__den) def reduce(self): g = Fraction.gcd(self.__num, self.__den) self.__num /= g self.__den /= g @staticmethod def gcd(n, m): if m == 0: return n else: return Fraction.gcd(m, n % m)
class Fraction(object): def __init__(self, num, den): self.__num = num self.__den = den self.reduce() def __str__(self): return '%d/%d' % (self.__num, self.__den) def __invert__(self): return fraction(self.__den, self.__num) def __neg__(self): return fraction(-self.__num, self.__den) def __pow__(self, pow): return fraction(self.__num ** pow, self.__den ** pow) def __float__(self): return float(self.__num / self.__den) def __int__(self): return int(self.__num / self.__den) def reduce(self): g = Fraction.gcd(self.__num, self.__den) self.__num /= g self.__den /= g @staticmethod def gcd(n, m): if m == 0: return n else: return Fraction.gcd(m, n % m)
# filter1.py to get even numbers from a list def is_dublicate(item): return not(item in mylist) mylist = ["Orange","Apple", "Banana", "Peach", "Banana"] new_list = list(filter(is_dublicate, mylist)) print(new_list)
def is_dublicate(item): return not item in mylist mylist = ['Orange', 'Apple', 'Banana', 'Peach', 'Banana'] new_list = list(filter(is_dublicate, mylist)) print(new_list)
class strongly_connected_component(): def __init__(self, graph=None, visited=None): self.graph = dict() self.visited = dict() self.stack=list() def add_vertex(self, v, graph, visited): if not graph.get(v): graph[v] = [] visited[v]=0 def add_edge(self, v1, v2, e, graph = None): if v1 not in graph: print("Vertex ", v1, " does not exist.") elif v2 not in graph: print("Vertex ", v2, " does not exist.") else: temp = [v2, e] graph[v1].append(temp) def reverse_graph(self, original_graph, reverse_graph, rev_graph_visited): for key in original_graph.keys(): self.add_vertex(key, reverse_graph, rev_graph_visited) for src, value in original_graph.items(): for dest in value: self.add_edge(dest[0], src, dest[1], reverse_graph) def dfs_visit(self, v,visited): visited[v]=1 for edges in self.graph[v]: if self.visited[edges[0]]!=1: self.dfs_visit(edges[0],self.visited) self.stack.append(v) def scc_dfs(self,v, reverse_graph, reverse_visited, res): reverse_visited[v] = 1 res.append(v) for edges in reverse_graph[v]: if reverse_visited[edges[0]]!=1: self.scc_dfs(edges[0], reverse_graph ,reverse_visited, res) def dfs_main(self): for key, value in self.graph.items(): if self.visited[key] != 1: self.dfs_visit(key,self.visited) def strongly_connected_components_driver(self): reverse_graph = dict() reverse_graph_visited = dict() res = [] final = [] self.dfs_main() self.reverse_graph(self.graph, reverse_graph, reverse_graph_visited) while self.stack: vertex = self.stack.pop() if reverse_graph_visited[vertex] != 1: self.scc_dfs(vertex, reverse_graph, reverse_graph_visited, res) final.append(res) res = [] return final def scc_main(self, fileName='directedGraph1.txt'): sc = strongly_connected_component() fileLines = [] with open(fileName,'r') as graph_file: fileLines = graph_file.read().splitlines() graph_info = fileLines[0].split(' ') number_of_vertices = graph_info[0] number_of_edges = graph_info[1] for i in range(1, len(fileLines)-1): edge_info = fileLines[i].split(' ') vertex_src = edge_info[0] vertex_dest = edge_info[1] edge_weight = edge_info[2] sc.add_vertex(vertex_src, sc.graph, sc.visited) sc.add_vertex(vertex_dest, sc.graph, sc.visited) sc.add_edge(vertex_src, vertex_dest, int(edge_weight),sc.graph) print("The strong connected components are:", sc.strongly_connected_components_driver()) if __name__ == "__main__": menu = { 1: 'Directed Graph 1', 2: 'Directed Graph 2',3: 'Directed Graph 3',4: 'Directed Graph 4', 5: 'Exit'} d = strongly_connected_component() fileName = '' while True: print('--------------------------------------------------') for key, value in menu.items(): print(key,'-',value) select_option = '' try: select_option = int(input('Please select the graph to be used to get the strongly connected component: ')) except: print('Please input a number') if select_option == 1: fileName = 'scc_1.txt' d.scc_main(fileName) elif select_option == 2: fileName = 'scc_2.txt' d.scc_main(fileName) elif select_option == 3: fileName = 'scc_3.txt' d.scc_main(fileName) elif select_option == 4: fileName = 'scc_4.txt' d.scc_main(fileName) elif select_option == 5: break else: print('Please enter input from the menu options')
class Strongly_Connected_Component: def __init__(self, graph=None, visited=None): self.graph = dict() self.visited = dict() self.stack = list() def add_vertex(self, v, graph, visited): if not graph.get(v): graph[v] = [] visited[v] = 0 def add_edge(self, v1, v2, e, graph=None): if v1 not in graph: print('Vertex ', v1, ' does not exist.') elif v2 not in graph: print('Vertex ', v2, ' does not exist.') else: temp = [v2, e] graph[v1].append(temp) def reverse_graph(self, original_graph, reverse_graph, rev_graph_visited): for key in original_graph.keys(): self.add_vertex(key, reverse_graph, rev_graph_visited) for (src, value) in original_graph.items(): for dest in value: self.add_edge(dest[0], src, dest[1], reverse_graph) def dfs_visit(self, v, visited): visited[v] = 1 for edges in self.graph[v]: if self.visited[edges[0]] != 1: self.dfs_visit(edges[0], self.visited) self.stack.append(v) def scc_dfs(self, v, reverse_graph, reverse_visited, res): reverse_visited[v] = 1 res.append(v) for edges in reverse_graph[v]: if reverse_visited[edges[0]] != 1: self.scc_dfs(edges[0], reverse_graph, reverse_visited, res) def dfs_main(self): for (key, value) in self.graph.items(): if self.visited[key] != 1: self.dfs_visit(key, self.visited) def strongly_connected_components_driver(self): reverse_graph = dict() reverse_graph_visited = dict() res = [] final = [] self.dfs_main() self.reverse_graph(self.graph, reverse_graph, reverse_graph_visited) while self.stack: vertex = self.stack.pop() if reverse_graph_visited[vertex] != 1: self.scc_dfs(vertex, reverse_graph, reverse_graph_visited, res) final.append(res) res = [] return final def scc_main(self, fileName='directedGraph1.txt'): sc = strongly_connected_component() file_lines = [] with open(fileName, 'r') as graph_file: file_lines = graph_file.read().splitlines() graph_info = fileLines[0].split(' ') number_of_vertices = graph_info[0] number_of_edges = graph_info[1] for i in range(1, len(fileLines) - 1): edge_info = fileLines[i].split(' ') vertex_src = edge_info[0] vertex_dest = edge_info[1] edge_weight = edge_info[2] sc.add_vertex(vertex_src, sc.graph, sc.visited) sc.add_vertex(vertex_dest, sc.graph, sc.visited) sc.add_edge(vertex_src, vertex_dest, int(edge_weight), sc.graph) print('The strong connected components are:', sc.strongly_connected_components_driver()) if __name__ == '__main__': menu = {1: 'Directed Graph 1', 2: 'Directed Graph 2', 3: 'Directed Graph 3', 4: 'Directed Graph 4', 5: 'Exit'} d = strongly_connected_component() file_name = '' while True: print('--------------------------------------------------') for (key, value) in menu.items(): print(key, '-', value) select_option = '' try: select_option = int(input('Please select the graph to be used to get the strongly connected component: ')) except: print('Please input a number') if select_option == 1: file_name = 'scc_1.txt' d.scc_main(fileName) elif select_option == 2: file_name = 'scc_2.txt' d.scc_main(fileName) elif select_option == 3: file_name = 'scc_3.txt' d.scc_main(fileName) elif select_option == 4: file_name = 'scc_4.txt' d.scc_main(fileName) elif select_option == 5: break else: print('Please enter input from the menu options')
AVAILABLE_LANGUAGES = { "english": "en", "indonesian": "id", "czech": "cs", "german": "de", "spanish": "es-419", "french": "fr", "italian": "it", "latvian": "lv", "lithuanian": "lt", "hungarian": "hu", "dutch": "nl", "norwegian": "no", "polish": "pl", "portuguese brasil": "pt-419", "portuguese portugal": "pt-150", "romanian": "ro", "slovak": "sk", "slovenian": "sl", "swedish": "sv", "vietnamese": "vi", "turkish": "tr", "greek": "el", "bulgarian": "bg", "russian": "ru", "serbian": "sr", "ukrainian": "uk", "hebrew": "he", "arabic": "ar", "marathi": "mr", "hindi": "hi", "bengali": "bn", "tamil": "ta", "telugu": "te", "malyalam": "ml", "thai": "th", "chinese simplified": "zh-Hans", "chinese traditional": "zh-Hant", "japanese": "ja", "korean": "ko" } AVAILABLE_COUNTRIES = { "Australia": "AU", "Botswana": "BW", "Canada ": "CA", "Ethiopia": "ET", "Ghana": "GH", "India ": "IN", "Indonesia": "ID", "Ireland": "IE", "Israel ": "IL", "Kenya": "KE", "Latvia": "LV", "Malaysia": "MY", "Namibia": "NA", "New Zealand": "NZ", "Nigeria": "NG", "Pakistan": "PK", "Philippines": "PH", "Singapore": "SG", "South Africa": "ZA", "Tanzania": "TZ", "Uganda": "UG", "United Kingdom": "GB", "United States": "US", "Zimbabwe": "ZW", "Czech Republic": "CZ", "Germany": "DE", "Austria": "AT", "Switzerland": "CH", "Argentina": "AR", "Chile": "CL", "Colombia": "CO", "Cuba": "CU", "Mexico": "MX", "Peru": "PE", "Venezuela": "VE", "Belgium ": "BE", "France": "FR", "Morocco": "MA", "Senegal": "SN", "Italy": "IT", "Lithuania": "LT", "Hungary": "HU", "Netherlands": "NL", "Norway": "NO", "Poland": "PL", "Brazil": "BR", "Portugal": "PT", "Romania": "RO", "Slovakia": "SK", "Slovenia": "SI", "Sweden": "SE", "Vietnam": "VN", "Turkey": "TR", "Greece": "GR", "Bulgaria": "BG", "Russia": "RU", "Ukraine ": "UA", "Serbia": "RS", "United Arab Emirates": "AE", "Saudi Arabia": "SA", "Lebanon": "LB", "Egypt": "EG", "Bangladesh": "BD", "Thailand": "TH", "China": "CN", "Taiwan": "TW", "Hong Kong": "HK", "Japan": "JP", "Republic of Korea": "KR" }
available_languages = {'english': 'en', 'indonesian': 'id', 'czech': 'cs', 'german': 'de', 'spanish': 'es-419', 'french': 'fr', 'italian': 'it', 'latvian': 'lv', 'lithuanian': 'lt', 'hungarian': 'hu', 'dutch': 'nl', 'norwegian': 'no', 'polish': 'pl', 'portuguese brasil': 'pt-419', 'portuguese portugal': 'pt-150', 'romanian': 'ro', 'slovak': 'sk', 'slovenian': 'sl', 'swedish': 'sv', 'vietnamese': 'vi', 'turkish': 'tr', 'greek': 'el', 'bulgarian': 'bg', 'russian': 'ru', 'serbian': 'sr', 'ukrainian': 'uk', 'hebrew': 'he', 'arabic': 'ar', 'marathi': 'mr', 'hindi': 'hi', 'bengali': 'bn', 'tamil': 'ta', 'telugu': 'te', 'malyalam': 'ml', 'thai': 'th', 'chinese simplified': 'zh-Hans', 'chinese traditional': 'zh-Hant', 'japanese': 'ja', 'korean': 'ko'} available_countries = {'Australia': 'AU', 'Botswana': 'BW', 'Canada ': 'CA', 'Ethiopia': 'ET', 'Ghana': 'GH', 'India ': 'IN', 'Indonesia': 'ID', 'Ireland': 'IE', 'Israel ': 'IL', 'Kenya': 'KE', 'Latvia': 'LV', 'Malaysia': 'MY', 'Namibia': 'NA', 'New Zealand': 'NZ', 'Nigeria': 'NG', 'Pakistan': 'PK', 'Philippines': 'PH', 'Singapore': 'SG', 'South Africa': 'ZA', 'Tanzania': 'TZ', 'Uganda': 'UG', 'United Kingdom': 'GB', 'United States': 'US', 'Zimbabwe': 'ZW', 'Czech Republic': 'CZ', 'Germany': 'DE', 'Austria': 'AT', 'Switzerland': 'CH', 'Argentina': 'AR', 'Chile': 'CL', 'Colombia': 'CO', 'Cuba': 'CU', 'Mexico': 'MX', 'Peru': 'PE', 'Venezuela': 'VE', 'Belgium ': 'BE', 'France': 'FR', 'Morocco': 'MA', 'Senegal': 'SN', 'Italy': 'IT', 'Lithuania': 'LT', 'Hungary': 'HU', 'Netherlands': 'NL', 'Norway': 'NO', 'Poland': 'PL', 'Brazil': 'BR', 'Portugal': 'PT', 'Romania': 'RO', 'Slovakia': 'SK', 'Slovenia': 'SI', 'Sweden': 'SE', 'Vietnam': 'VN', 'Turkey': 'TR', 'Greece': 'GR', 'Bulgaria': 'BG', 'Russia': 'RU', 'Ukraine ': 'UA', 'Serbia': 'RS', 'United Arab Emirates': 'AE', 'Saudi Arabia': 'SA', 'Lebanon': 'LB', 'Egypt': 'EG', 'Bangladesh': 'BD', 'Thailand': 'TH', 'China': 'CN', 'Taiwan': 'TW', 'Hong Kong': 'HK', 'Japan': 'JP', 'Republic of Korea': 'KR'}
sala = [] def AdicionarSala(cod_sala,lotacao): aux = [cod_sala,lotacao] sala.append(aux) print (" === Sala adicionada === ") def StatusOcupada(cod_sala): for s in sala: if (s[0] == cod_sala): s[1] = "Ocupada" return s return None def StatusLivre(cod_sala): for s in sala: if (s[0] == cod_sala): s[1] = "Ocupada" return s return None def BuscarSala(cod_sala): for s in sala: if (s[0] == cod_sala): print (s) return s return None def ListarSala(): global sala print (sala) return sala def RemoverSala(cod_sala): for s in sala: if (s[0] == cod_sala): sala.remove(s) print (" ==== Sala removida === ") return True return False def RemoverTodasSalas(): global sala sala = [] return sala def IniciarSala(): AdicionarSala(1,"livre") AdicionarSala(2,"ocupada")
sala = [] def adicionar_sala(cod_sala, lotacao): aux = [cod_sala, lotacao] sala.append(aux) print(' === Sala adicionada === ') def status_ocupada(cod_sala): for s in sala: if s[0] == cod_sala: s[1] = 'Ocupada' return s return None def status_livre(cod_sala): for s in sala: if s[0] == cod_sala: s[1] = 'Ocupada' return s return None def buscar_sala(cod_sala): for s in sala: if s[0] == cod_sala: print(s) return s return None def listar_sala(): global sala print(sala) return sala def remover_sala(cod_sala): for s in sala: if s[0] == cod_sala: sala.remove(s) print(' ==== Sala removida === ') return True return False def remover_todas_salas(): global sala sala = [] return sala def iniciar_sala(): adicionar_sala(1, 'livre') adicionar_sala(2, 'ocupada')
class InvalidStateTransition(Exception): pass class State(object): def __init__(self, initial=False, **kwargs): self.initial = initial def __eq__(self, other): if isinstance(other, basestring): return self.name == other elif isinstance(other, State): return self.name == other.name else: return False def __ne__(self, other): return not self == other class Event(object): def __init__(self, **kwargs): self.to_state = kwargs.get('to_state', None) self.from_states = tuple() from_state_args = kwargs.get('from_states', tuple()) if isinstance(from_state_args, (tuple, list)): self.from_states = tuple(from_state_args) else: self.from_states = (from_state_args,)
class Invalidstatetransition(Exception): pass class State(object): def __init__(self, initial=False, **kwargs): self.initial = initial def __eq__(self, other): if isinstance(other, basestring): return self.name == other elif isinstance(other, State): return self.name == other.name else: return False def __ne__(self, other): return not self == other class Event(object): def __init__(self, **kwargs): self.to_state = kwargs.get('to_state', None) self.from_states = tuple() from_state_args = kwargs.get('from_states', tuple()) if isinstance(from_state_args, (tuple, list)): self.from_states = tuple(from_state_args) else: self.from_states = (from_state_args,)
__author__ = 'Aleksander Chrabaszcz' __all__ = ['config', 'parser', 'pyslate'] __version__ = '1.1'
__author__ = 'Aleksander Chrabaszcz' __all__ = ['config', 'parser', 'pyslate'] __version__ = '1.1'
H, W = map(int, input().split()) for _ in range(H): C = input() print(C) print(C)
(h, w) = map(int, input().split()) for _ in range(H): c = input() print(C) print(C)
public_key = 28 # Store the discovered factors in this list factors = [] # Begin testing at 2 test_number = 2 # Loop through all numbers from 2 up until the public_key number while test_number < public_key: # If the public key divides exactly into the test_number, it is a factor if public_key % test_number == 0: factors.append(test_number) # Move on to the next number test_number += 1 # Print the result print(factors)
public_key = 28 factors = [] test_number = 2 while test_number < public_key: if public_key % test_number == 0: factors.append(test_number) test_number += 1 print(factors)
# Display default_screen_width = 940 default_screen_height = 600 screen_width = default_screen_width screen_height = default_screen_height is_native = False max_tps = 16 board_width = 13 board_height = 9 theme = "neon" # neon/paper/football # Sound sound_volume = 0.1 sound_muted = False
default_screen_width = 940 default_screen_height = 600 screen_width = default_screen_width screen_height = default_screen_height is_native = False max_tps = 16 board_width = 13 board_height = 9 theme = 'neon' sound_volume = 0.1 sound_muted = False
fib = [1, 1] for i in range(2, 11): fib.append(fib[i - 1] + fib[i - 2]) def c2f(c): n = ord(c) b = '' for i in range(10, -1, -1): if n >= fib[i]: n -= fib[i] b += '1' else: b += '0' return b ALPHABET = [chr(i) for i in range(33,126)] print(ALPHABET) flag = ['10000100100','10010000010','10010001010','10000100100','10010010010','10001000000','10100000000','10000100010','00101010000','10010010000','00101001010','10000101000','10000010010','00101010000','10010000000','10000101000','10000010010','10001000000','00101000100','10000100010','10010000100','00010101010','00101000100','00101000100','00101001010','10000101000','10100000100','00000100100'] flagd = '' while(len(flagd) <= len(flag)): for i in flag: for c in ALPHABET: if c2f(c) == i: flagd += c print(c) break; break; print(flagd)
fib = [1, 1] for i in range(2, 11): fib.append(fib[i - 1] + fib[i - 2]) def c2f(c): n = ord(c) b = '' for i in range(10, -1, -1): if n >= fib[i]: n -= fib[i] b += '1' else: b += '0' return b alphabet = [chr(i) for i in range(33, 126)] print(ALPHABET) flag = ['10000100100', '10010000010', '10010001010', '10000100100', '10010010010', '10001000000', '10100000000', '10000100010', '00101010000', '10010010000', '00101001010', '10000101000', '10000010010', '00101010000', '10010000000', '10000101000', '10000010010', '10001000000', '00101000100', '10000100010', '10010000100', '00010101010', '00101000100', '00101000100', '00101001010', '10000101000', '10100000100', '00000100100'] flagd = '' while len(flagd) <= len(flag): for i in flag: for c in ALPHABET: if c2f(c) == i: flagd += c print(c) break break print(flagd)
# -*- coding: utf-8 -*- __version__ = "20.4.1a" __author__ = "Taro Sato" __author_email__ = "[email protected]" __license__ = "MIT"
__version__ = '20.4.1a' __author__ = 'Taro Sato' __author_email__ = '[email protected]' __license__ = 'MIT'
# represents the format of the string (see http://docs.python.org/library/datetime.html#strftime-strptime-behavior) # format symbol "z" doesn't wok sometimes, maybe you will need to change csv2youtrack.to_unix_date(time_string) DATE_FORMAT_STRING = "" FIELD_NAMES = { "Project" : "project", "Summary" : "summary", "Reporter" : "reporterName", "Created" : "created", "Updated" : "updated", "Description" : "description" } FIELD_TYPES = { "Fix versions" : "version[*]", "State" : "state[1]", "Assignee" : "user[1]", "Affected versions" : "version[*]", "Fixed in build" : "build[1]", "Priority" : "enum[1]", "Subsystem" : "ownedField[1]", "Browser" : "enum[1]", "OS" : "enum[1]", "Verified in build" : "build[1]", "Verified by" : "user[1]", "Affected builds" : "build[*]", "Fixed in builds" : "build[*]", "Reviewed by" : "user[1]", "Story points" : "integer", "Value" : "integer", "Marketing value" : "integer" } CONVERSION = {} CSV_DELIMITER = ","
date_format_string = '' field_names = {'Project': 'project', 'Summary': 'summary', 'Reporter': 'reporterName', 'Created': 'created', 'Updated': 'updated', 'Description': 'description'} field_types = {'Fix versions': 'version[*]', 'State': 'state[1]', 'Assignee': 'user[1]', 'Affected versions': 'version[*]', 'Fixed in build': 'build[1]', 'Priority': 'enum[1]', 'Subsystem': 'ownedField[1]', 'Browser': 'enum[1]', 'OS': 'enum[1]', 'Verified in build': 'build[1]', 'Verified by': 'user[1]', 'Affected builds': 'build[*]', 'Fixed in builds': 'build[*]', 'Reviewed by': 'user[1]', 'Story points': 'integer', 'Value': 'integer', 'Marketing value': 'integer'} conversion = {} csv_delimiter = ','
# taken from: http://pjreddie.com/projects/mnist-in-csv/ # convert reads the binary data and outputs a csv file def convert(image_file_path, label_file_path, csv_file_path, n): # open files images_file = open(image_file_path, "rb") labels_file = open(label_file_path, "rb") csv_file = open(csv_file_path, "w") # read some kind of header images_file.read(16) labels_file.read(8) # prepare array images = [] # read images and labels for _ in range(n): image = [] for _ in range(28*28): image.append(ord(images_file.read(1))) image.append(ord(labels_file.read(1))) images.append(image) # write csv rows for image in images: csv_file.write(",".join(str(pix) for pix in image)+"\n") # close files images_file.close() csv_file.close() labels_file.close() # convert train data set convert( "train-images-idx3-ubyte", "train-labels-idx1-ubyte", "train.csv", 60000 ) # convert test data set convert( "t10k-images-idx3-ubyte", "t10k-labels-idx1-ubyte", "test.csv", 10000 )
def convert(image_file_path, label_file_path, csv_file_path, n): images_file = open(image_file_path, 'rb') labels_file = open(label_file_path, 'rb') csv_file = open(csv_file_path, 'w') images_file.read(16) labels_file.read(8) images = [] for _ in range(n): image = [] for _ in range(28 * 28): image.append(ord(images_file.read(1))) image.append(ord(labels_file.read(1))) images.append(image) for image in images: csv_file.write(','.join((str(pix) for pix in image)) + '\n') images_file.close() csv_file.close() labels_file.close() convert('train-images-idx3-ubyte', 'train-labels-idx1-ubyte', 'train.csv', 60000) convert('t10k-images-idx3-ubyte', 't10k-labels-idx1-ubyte', 'test.csv', 10000)
# SPDX-License-Identifier: MIT # Source: https://github.com/microsoft/MaskFlownet/tree/5cba12772e2201f0d1c1e27161d224e585334571 class Reader: def __init__(self, obj, full_attr=""): self._object = obj self._full_attr = full_attr def __getattr__(self, name): if self._object is None: ret = None else: ret = self._object.get(name, None) return Reader(ret, self._full_attr + '.' + name) def get(self, default=None): if self._object is None: print('Default FLAGS.{} to {}'.format(self._full_attr, default)) return default else: return self._object @property def value(self): return self._object
class Reader: def __init__(self, obj, full_attr=''): self._object = obj self._full_attr = full_attr def __getattr__(self, name): if self._object is None: ret = None else: ret = self._object.get(name, None) return reader(ret, self._full_attr + '.' + name) def get(self, default=None): if self._object is None: print('Default FLAGS.{} to {}'.format(self._full_attr, default)) return default else: return self._object @property def value(self): return self._object
# Write your solution for 1.4 here! def is_prime(x): # mod = x for i in range(x-1, 1, -1): if x % i == 0 : return False return True # else: # return True # is_prime(8) print(is_prime(5191))
def is_prime(x): for i in range(x - 1, 1, -1): if x % i == 0: return False return True print(is_prime(5191))
class InternalServerError(Exception): pass class SchemaValidationError(Exception): pass class EmailAlreadyExistsError(Exception): pass class UnauthorizedError(Exception): pass class NoAuthorizationError(Exception): pass class UpdatingUserError(Exception): pass class DeletingUserError(Exception): pass class UserNotExistsError(Exception): pass errors = { "InternalServerError": { "message": "Something went wrong", "status": 500 }, "SchemaValidationError": { "message": "Request is missing required fields", "status": 400 }, "EmailAlreadyExistsError": { "message": "User with given email address already exists", "status": 400 }, "UnauthorizedError": { "message": "Invalid username or password", "status": 401 }, "NoAuthorizationError": { "message": "Missing Authorization Header", "status": 401 }, "UpdatingUserError": { "message": "Updating user added by other is forbidden", "status": 403 }, "DeletingUserError": { "message": "Deleting user added by other is forbidden", "status": 403 }, "UserNotExistsError": { "message": "User with given id doesn't exists", "status": 400 } }
class Internalservererror(Exception): pass class Schemavalidationerror(Exception): pass class Emailalreadyexistserror(Exception): pass class Unauthorizederror(Exception): pass class Noauthorizationerror(Exception): pass class Updatingusererror(Exception): pass class Deletingusererror(Exception): pass class Usernotexistserror(Exception): pass errors = {'InternalServerError': {'message': 'Something went wrong', 'status': 500}, 'SchemaValidationError': {'message': 'Request is missing required fields', 'status': 400}, 'EmailAlreadyExistsError': {'message': 'User with given email address already exists', 'status': 400}, 'UnauthorizedError': {'message': 'Invalid username or password', 'status': 401}, 'NoAuthorizationError': {'message': 'Missing Authorization Header', 'status': 401}, 'UpdatingUserError': {'message': 'Updating user added by other is forbidden', 'status': 403}, 'DeletingUserError': {'message': 'Deleting user added by other is forbidden', 'status': 403}, 'UserNotExistsError': {'message': "User with given id doesn't exists", 'status': 400}}
# # PySNMP MIB module DELL-NETWORKING-COPY-CONFIG-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/DELL-NETWORKING-COPY-CONFIG-MIB # Produced by pysmi-0.3.4 at Wed May 1 12:37:52 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, ValueSizeConstraint, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "ValueRangeConstraint", "SingleValueConstraint", "ValueSizeConstraint", "ConstraintsIntersection") dellNetMgmt, = mibBuilder.importSymbols("DELL-NETWORKING-SMI", "dellNetMgmt") InetAddress, InetAddressType = mibBuilder.importSymbols("INET-ADDRESS-MIB", "InetAddress", "InetAddressType") ModuleCompliance, NotificationGroup, ObjectGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup", "ObjectGroup") NotificationType, Integer32, MibScalar, MibTable, MibTableRow, MibTableColumn, MibIdentifier, Bits, Counter32, ObjectIdentity, Counter64, ModuleIdentity, Gauge32, Unsigned32, IpAddress, iso, TimeTicks = mibBuilder.importSymbols("SNMPv2-SMI", "NotificationType", "Integer32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "MibIdentifier", "Bits", "Counter32", "ObjectIdentity", "Counter64", "ModuleIdentity", "Gauge32", "Unsigned32", "IpAddress", "iso", "TimeTicks") RowStatus, DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "RowStatus", "DisplayString", "TextualConvention") dellNetCopyConfigMib = ModuleIdentity((1, 3, 6, 1, 4, 1, 6027, 3, 5)) dellNetCopyConfigMib.setRevisions(('2009-05-14 13:00', '2007-06-19 12:00', '2003-03-01 12:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: dellNetCopyConfigMib.setRevisionsDescriptions(('Added New enum for usbflash filesystem in Exascale', 'Update description to copy from remote server to local', 'Initial Revision',)) if mibBuilder.loadTexts: dellNetCopyConfigMib.setLastUpdated('200905141300Z') if mibBuilder.loadTexts: dellNetCopyConfigMib.setOrganization('Dell Inc.') if mibBuilder.loadTexts: dellNetCopyConfigMib.setContactInfo('http://www.dell.com/support') if mibBuilder.loadTexts: dellNetCopyConfigMib.setDescription('Dell Networking OS Copy Config MIB provides copying of running-config to to startup-config and vice-versa, and Dell Networking OS files to local disk or other system via ftp or tftp. ') dellNetCopyConfigObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1)) dellNetCopyConfig = MibIdentifier((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 1)) dellNetCopyConfigTraps = MibIdentifier((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 2)) class DellNetConfigFileLocation(Integer32): subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7)) namedValues = NamedValues(("flash", 1), ("slot0", 2), ("tftp", 3), ("ftp", 4), ("scp", 5), ("usbflash", 6), ("nfsmount", 7)) class DellNetConfigFileType(Integer32): subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3)) namedValues = NamedValues(("dellNetFile", 1), ("runningConfig", 2), ("startupConfig", 3)) class DellNetConfigCopyState(Integer32): subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3)) namedValues = NamedValues(("running", 1), ("successful", 2), ("failed", 3)) class DellNetConfigCopyFailCause(Integer32): subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7)) namedValues = NamedValues(("badFileName", 1), ("copyInProgress", 2), ("diskFull", 3), ("fileExist", 4), ("fileNotFound", 5), ("timeout", 6), ("unknown", 7)) dellNetCopyTable = MibTable((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 1, 1), ) if mibBuilder.loadTexts: dellNetCopyTable.setStatus('current') if mibBuilder.loadTexts: dellNetCopyTable.setDescription('A table of config-copy requests.') dellNetCopyEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 1, 1, 1), ).setIndexNames((0, "DELL-NETWORKING-COPY-CONFIG-MIB", "copyConfigIndex")) if mibBuilder.loadTexts: dellNetCopyEntry.setStatus('current') if mibBuilder.loadTexts: dellNetCopyEntry.setDescription('A config-copy request. To use this copy on NMS, user must first query the MIB. if the query returns the result of the previous copied and there is no pending copy operation, user can submit a SNMP SET with a random number as index with the appropraite information as specified by this MIB and the row status as CreateAndGo. The system will only keep the last 5 copy requests as the history. If there are ten entries in the copy request table, the subsequent copy request will replace the existing one in the copy table. 1) To copy running-config from local directory to startup-config. Set the following mib objects in the copy table copySrcFileType : runningConfig (2) copyDestFileType : startupConfig (3) 2) To copy startup-config from local directory to a remote site. Set the following mib objects in the copy table copySrcFileType : startupConfig (3) copyDestFileType : dellNetFile (1) copyDestFileLocation : ftp (4) copyDestFileName : /user/tester1/ftp/ copyServerAddress : 172.20.10.123 copyUserName : tester1 copyUserPassword : mypasswd 3) To copy a file from local directory to a remote site. Set the following mib objects in the copy table copySrcFileType : dellNetFile (1) copySrcFileLocation : slot0 (2) copySrcFileName : NVTRACE_LOG_DIR/LP4-nvtrace-0 copyDestFileType : dellNetFile (1) copyDestFileLocation : ftp (4) copyDestFileName : /usr/tester1/trace/backup/LP4-nvtrace-0 copyServerAddress : 172.20.10.123 copyUserName : tester1 copyUserPassword : mypasswd ') copyConfigIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 1, 1, 1, 1), Integer32()) if mibBuilder.loadTexts: copyConfigIndex.setStatus('current') if mibBuilder.loadTexts: copyConfigIndex.setDescription('To initiate a config copy request, user should assign a positive random value as an index. ') copySrcFileType = MibTableColumn((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 1, 1, 1, 2), DellNetConfigFileType()).setMaxAccess("readwrite") if mibBuilder.loadTexts: copySrcFileType.setStatus('current') if mibBuilder.loadTexts: copySrcFileType.setDescription('Specifies the type of file to copy from. if the copySrcFileType is runningConfig(2) or startupConfig(3), the default DellNetConfigFileLocation is flash(1). If the copySrcFileType has the value of dellNetFile(1), it is expected that the copySrcFileLocation and copySrcFileName must also be spcified. The three objects together will uniquely identify the source file. ') copySrcFileLocation = MibTableColumn((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 1, 1, 1, 3), DellNetConfigFileLocation()).setMaxAccess("readwrite") if mibBuilder.loadTexts: copySrcFileLocation.setStatus('current') if mibBuilder.loadTexts: copySrcFileLocation.setDescription('Specifies the location of source file. If the copySrcFileType has the value of dellNetFile(1), it is expected that the copySrcFileType and copySrcFileName must also be spcified. The three objects together will uniquely identify the source file. If the copySrcFileLocation has the value of ftp(4) or scp(5), it is expected the login information liked copyServerAddress, copyUserName, and copyUserPassword also be spcified. ') copySrcFileName = MibTableColumn((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 1, 1, 1, 4), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: copySrcFileName.setStatus('current') if mibBuilder.loadTexts: copySrcFileName.setDescription('The file name (including the path, if applicable) of the file. If copySourceFileType is set to runningConfig or startupConfig, copySrcFileName is not needed. ') copyDestFileType = MibTableColumn((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 1, 1, 1, 5), DellNetConfigFileType()).setMaxAccess("readwrite") if mibBuilder.loadTexts: copyDestFileType.setStatus('current') if mibBuilder.loadTexts: copyDestFileType.setDescription('Specifies the type of file to copy to. if the copyDestFileType is runningConfig(2) or startupConfig(3), the default dellNetDestFileLocation is flash(1). If the copyDestFileType has the value of dellNetFile(1), it is expected that the copyDestFileLocation and copyDestFileName must also be spcified. The three objects together will uniquely identify the destination file. ') copyDestFileLocation = MibTableColumn((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 1, 1, 1, 6), DellNetConfigFileLocation()).setMaxAccess("readwrite") if mibBuilder.loadTexts: copyDestFileLocation.setStatus('current') if mibBuilder.loadTexts: copyDestFileLocation.setDescription('Specifies the location of destination file. If the copyDestFileType has the value of dellNetFile(1), it is expected that the copyDestFileType and copyDestFileName must also be spcified. The three objects together will uniquely identify the destination file. If the copyDestFileLocation has the value of ftp(4) or scp(5), it is expected the login information liked copyServerAddress, copyUserName, and copyUserPassword also be spcified. ') copyDestFileName = MibTableColumn((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 1, 1, 1, 7), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: copyDestFileName.setStatus('current') if mibBuilder.loadTexts: copyDestFileName.setDescription('Specifies the location of destination file. If the copyDestFileType has the value of dellNetFile(1), it is expected that the dellNetCopyDestFileTyp and copyDestFileLocation must also be spcified. The three objects together will uniquely identify the source file. If the copyDestFileLocation has the value of ftp(4) or scp(5), it is expected the login information liked copyServerAddress, copyUserName, and copyUserPassword also be spcified. ') copyServerAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 1, 1, 1, 8), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: copyServerAddress.setStatus('deprecated') if mibBuilder.loadTexts: copyServerAddress.setDescription('The ip address of the tftp server from (or to) which to copy the configuration file. Values of 0.0.0.0 or FF.FF.FF.FF for copyServerAddress are not allowed. If the copyDestFileLocation has the value of ftp(4) or scp(5), it is expected the login information liked copyServerAddress, copyUserName, and copyUserPassword also be spcified. ') copyUserName = MibTableColumn((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 1, 1, 1, 9), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 15))).setMaxAccess("readwrite") if mibBuilder.loadTexts: copyUserName.setStatus('current') if mibBuilder.loadTexts: copyUserName.setDescription('Remote user name for copy via ftp, or scp. If the copyDestFileLocation has the value of ftp(4) or scp(5), it is expected the login information liked copyServerAddress, copyUserName, and copyUserPassword also be spcified. ') copyUserPassword = MibTableColumn((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 1, 1, 1, 10), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 15))).setMaxAccess("readwrite") if mibBuilder.loadTexts: copyUserPassword.setStatus('current') if mibBuilder.loadTexts: copyUserPassword.setDescription('Password used by ftp, scp for copying a file to an ftp/scp server. If the copyDestFileLocation has the value of ftp(4) or scp(5), it is expected the login information liked copyServerAddress, copyUserName, and copyUserPassword also be spcified. ') copyState = MibTableColumn((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 1, 1, 1, 11), DellNetConfigCopyState()).setMaxAccess("readonly") if mibBuilder.loadTexts: copyState.setStatus('current') if mibBuilder.loadTexts: copyState.setDescription(' The state of config-copy operation. ') copyTimeStarted = MibTableColumn((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 1, 1, 1, 12), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: copyTimeStarted.setStatus('current') if mibBuilder.loadTexts: copyTimeStarted.setDescription(' The timetick when the copy started. ') copyTimeCompleted = MibTableColumn((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 1, 1, 1, 13), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: copyTimeCompleted.setStatus('current') if mibBuilder.loadTexts: copyTimeCompleted.setDescription(' The timetick when the copy completed. ') copyFailCause = MibTableColumn((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 1, 1, 1, 14), DellNetConfigCopyFailCause()).setMaxAccess("readonly") if mibBuilder.loadTexts: copyFailCause.setStatus('current') if mibBuilder.loadTexts: copyFailCause.setDescription(' The reason a config-copy request failed. ') copyEntryRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 1, 1, 1, 15), RowStatus()).setMaxAccess("readwrite") if mibBuilder.loadTexts: copyEntryRowStatus.setStatus('current') if mibBuilder.loadTexts: copyEntryRowStatus.setDescription(' The state of the copy operation. Uses CreateAndGo when you are performing the copy. The state is set to active when the copy is completed. ') copyServerInetAddressType = MibTableColumn((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 1, 1, 1, 16), InetAddressType()).setMaxAccess("readwrite") if mibBuilder.loadTexts: copyServerInetAddressType.setStatus('current') if mibBuilder.loadTexts: copyServerInetAddressType.setDescription(' The address type of copyServerInetAddress. Only ipv4 (1), ipv6 (2) and dns (16) types are supported. ') copyServerInetAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 1, 1, 1, 17), InetAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: copyServerInetAddress.setStatus('current') if mibBuilder.loadTexts: copyServerInetAddress.setDescription(' The IP address of the address ftp/tftp/scp server from or to which to copy the configuration file. If the copyDestFileLocation has the value of ftp(4) or scp(5), it is expected the login information copyUserName and copyUserPassword also be spcified. ') copyAlarmMibNotifications = MibIdentifier((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 2, 0)) copyAlarmVariable = MibIdentifier((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 2, 1)) copyAlarmLevel = MibScalar((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 2, 1, 1), Integer32()).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: copyAlarmLevel.setStatus('current') if mibBuilder.loadTexts: copyAlarmLevel.setDescription('the message warning level') copyAlarmString = MibScalar((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 2, 1, 2), OctetString()).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: copyAlarmString.setStatus('current') if mibBuilder.loadTexts: copyAlarmString.setDescription('An generic string value in the TRAP object') copyAlarmIndex = MibScalar((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 2, 1, 3), Integer32()).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: copyAlarmIndex.setStatus('current') if mibBuilder.loadTexts: copyAlarmIndex.setDescription("the index of the current copy. Indicates the index of the current copy, i.e. copyConfigIndex of dellNetCopyTable. Set to '-1' if copy executed by CLI") copyConfigCompleted = NotificationType((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 2, 0, 1)).setObjects(("DELL-NETWORKING-COPY-CONFIG-MIB", "copyAlarmLevel"), ("DELL-NETWORKING-COPY-CONFIG-MIB", "copyAlarmString"), ("DELL-NETWORKING-COPY-CONFIG-MIB", "copyAlarmIndex")) if mibBuilder.loadTexts: copyConfigCompleted.setStatus('current') if mibBuilder.loadTexts: copyConfigCompleted.setDescription('The agent generate this trap when a copy operational is completed.') configConflict = NotificationType((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 2, 0, 2)).setObjects(("DELL-NETWORKING-COPY-CONFIG-MIB", "copyAlarmLevel"), ("DELL-NETWORKING-COPY-CONFIG-MIB", "copyAlarmString"), ("DELL-NETWORKING-COPY-CONFIG-MIB", "copyAlarmIndex")) if mibBuilder.loadTexts: configConflict.setStatus('current') if mibBuilder.loadTexts: configConflict.setDescription('The agent generate this trap when a configuration conflict found during audit.') configConflictClear = NotificationType((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 2, 0, 3)).setObjects(("DELL-NETWORKING-COPY-CONFIG-MIB", "copyAlarmLevel"), ("DELL-NETWORKING-COPY-CONFIG-MIB", "copyAlarmString"), ("DELL-NETWORKING-COPY-CONFIG-MIB", "copyAlarmIndex")) if mibBuilder.loadTexts: configConflictClear.setStatus('current') if mibBuilder.loadTexts: configConflictClear.setDescription('The agent generate this trap when a configuration conflict resolved during audit.') batchConfigCommitProgress = NotificationType((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 2, 0, 4)).setObjects(("DELL-NETWORKING-COPY-CONFIG-MIB", "copyAlarmLevel"), ("DELL-NETWORKING-COPY-CONFIG-MIB", "copyAlarmString"), ("DELL-NETWORKING-COPY-CONFIG-MIB", "copyAlarmIndex")) if mibBuilder.loadTexts: batchConfigCommitProgress.setStatus('current') if mibBuilder.loadTexts: batchConfigCommitProgress.setDescription('The agent generate this trap when a configuration commit is initiated.') batchConfigCommitCompleted = NotificationType((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 2, 0, 5)).setObjects(("DELL-NETWORKING-COPY-CONFIG-MIB", "copyAlarmLevel"), ("DELL-NETWORKING-COPY-CONFIG-MIB", "copyAlarmString"), ("DELL-NETWORKING-COPY-CONFIG-MIB", "copyAlarmIndex")) if mibBuilder.loadTexts: batchConfigCommitCompleted.setStatus('current') if mibBuilder.loadTexts: batchConfigCommitCompleted.setDescription('The agent generate this trap when a configuration commit is completed.') mibBuilder.exportSymbols("DELL-NETWORKING-COPY-CONFIG-MIB", dellNetCopyConfigTraps=dellNetCopyConfigTraps, dellNetCopyConfig=dellNetCopyConfig, DellNetConfigFileType=DellNetConfigFileType, copyAlarmMibNotifications=copyAlarmMibNotifications, copyAlarmLevel=copyAlarmLevel, dellNetCopyConfigMib=dellNetCopyConfigMib, copyFailCause=copyFailCause, copyDestFileName=copyDestFileName, copyServerInetAddressType=copyServerInetAddressType, DellNetConfigFileLocation=DellNetConfigFileLocation, copyTimeStarted=copyTimeStarted, copySrcFileLocation=copySrcFileLocation, copyDestFileLocation=copyDestFileLocation, copyState=copyState, copySrcFileType=copySrcFileType, copyConfigCompleted=copyConfigCompleted, copyUserPassword=copyUserPassword, batchConfigCommitProgress=batchConfigCommitProgress, dellNetCopyConfigObjects=dellNetCopyConfigObjects, DellNetConfigCopyState=DellNetConfigCopyState, copyConfigIndex=copyConfigIndex, copyServerInetAddress=copyServerInetAddress, DellNetConfigCopyFailCause=DellNetConfigCopyFailCause, dellNetCopyEntry=dellNetCopyEntry, copyDestFileType=copyDestFileType, copyAlarmVariable=copyAlarmVariable, copyServerAddress=copyServerAddress, batchConfigCommitCompleted=batchConfigCommitCompleted, copyAlarmIndex=copyAlarmIndex, copySrcFileName=copySrcFileName, PYSNMP_MODULE_ID=dellNetCopyConfigMib, copyTimeCompleted=copyTimeCompleted, configConflict=configConflict, configConflictClear=configConflictClear, copyUserName=copyUserName, dellNetCopyTable=dellNetCopyTable, copyAlarmString=copyAlarmString, copyEntryRowStatus=copyEntryRowStatus)
(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, value_size_constraint, constraints_intersection) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsUnion', 'ValueRangeConstraint', 'SingleValueConstraint', 'ValueSizeConstraint', 'ConstraintsIntersection') (dell_net_mgmt,) = mibBuilder.importSymbols('DELL-NETWORKING-SMI', 'dellNetMgmt') (inet_address, inet_address_type) = mibBuilder.importSymbols('INET-ADDRESS-MIB', 'InetAddress', 'InetAddressType') (module_compliance, notification_group, object_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup', 'ObjectGroup') (notification_type, integer32, mib_scalar, mib_table, mib_table_row, mib_table_column, mib_identifier, bits, counter32, object_identity, counter64, module_identity, gauge32, unsigned32, ip_address, iso, time_ticks) = mibBuilder.importSymbols('SNMPv2-SMI', 'NotificationType', 'Integer32', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'MibIdentifier', 'Bits', 'Counter32', 'ObjectIdentity', 'Counter64', 'ModuleIdentity', 'Gauge32', 'Unsigned32', 'IpAddress', 'iso', 'TimeTicks') (row_status, display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'RowStatus', 'DisplayString', 'TextualConvention') dell_net_copy_config_mib = module_identity((1, 3, 6, 1, 4, 1, 6027, 3, 5)) dellNetCopyConfigMib.setRevisions(('2009-05-14 13:00', '2007-06-19 12:00', '2003-03-01 12:00')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: dellNetCopyConfigMib.setRevisionsDescriptions(('Added New enum for usbflash filesystem in Exascale', 'Update description to copy from remote server to local', 'Initial Revision')) if mibBuilder.loadTexts: dellNetCopyConfigMib.setLastUpdated('200905141300Z') if mibBuilder.loadTexts: dellNetCopyConfigMib.setOrganization('Dell Inc.') if mibBuilder.loadTexts: dellNetCopyConfigMib.setContactInfo('http://www.dell.com/support') if mibBuilder.loadTexts: dellNetCopyConfigMib.setDescription('Dell Networking OS Copy Config MIB provides copying of running-config to to startup-config and vice-versa, and Dell Networking OS files to local disk or other system via ftp or tftp. ') dell_net_copy_config_objects = mib_identifier((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1)) dell_net_copy_config = mib_identifier((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 1)) dell_net_copy_config_traps = mib_identifier((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 2)) class Dellnetconfigfilelocation(Integer32): subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7)) named_values = named_values(('flash', 1), ('slot0', 2), ('tftp', 3), ('ftp', 4), ('scp', 5), ('usbflash', 6), ('nfsmount', 7)) class Dellnetconfigfiletype(Integer32): subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2, 3)) named_values = named_values(('dellNetFile', 1), ('runningConfig', 2), ('startupConfig', 3)) class Dellnetconfigcopystate(Integer32): subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2, 3)) named_values = named_values(('running', 1), ('successful', 2), ('failed', 3)) class Dellnetconfigcopyfailcause(Integer32): subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7)) named_values = named_values(('badFileName', 1), ('copyInProgress', 2), ('diskFull', 3), ('fileExist', 4), ('fileNotFound', 5), ('timeout', 6), ('unknown', 7)) dell_net_copy_table = mib_table((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 1, 1)) if mibBuilder.loadTexts: dellNetCopyTable.setStatus('current') if mibBuilder.loadTexts: dellNetCopyTable.setDescription('A table of config-copy requests.') dell_net_copy_entry = mib_table_row((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 1, 1, 1)).setIndexNames((0, 'DELL-NETWORKING-COPY-CONFIG-MIB', 'copyConfigIndex')) if mibBuilder.loadTexts: dellNetCopyEntry.setStatus('current') if mibBuilder.loadTexts: dellNetCopyEntry.setDescription('A config-copy request. To use this copy on NMS, user must first query the MIB. if the query returns the result of the previous copied and there is no pending copy operation, user can submit a SNMP SET with a random number as index with the appropraite information as specified by this MIB and the row status as CreateAndGo. The system will only keep the last 5 copy requests as the history. If there are ten entries in the copy request table, the subsequent copy request will replace the existing one in the copy table. 1) To copy running-config from local directory to startup-config. Set the following mib objects in the copy table copySrcFileType : runningConfig (2) copyDestFileType : startupConfig (3) 2) To copy startup-config from local directory to a remote site. Set the following mib objects in the copy table copySrcFileType : startupConfig (3) copyDestFileType : dellNetFile (1) copyDestFileLocation : ftp (4) copyDestFileName : /user/tester1/ftp/ copyServerAddress : 172.20.10.123 copyUserName : tester1 copyUserPassword : mypasswd 3) To copy a file from local directory to a remote site. Set the following mib objects in the copy table copySrcFileType : dellNetFile (1) copySrcFileLocation : slot0 (2) copySrcFileName : NVTRACE_LOG_DIR/LP4-nvtrace-0 copyDestFileType : dellNetFile (1) copyDestFileLocation : ftp (4) copyDestFileName : /usr/tester1/trace/backup/LP4-nvtrace-0 copyServerAddress : 172.20.10.123 copyUserName : tester1 copyUserPassword : mypasswd ') copy_config_index = mib_table_column((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 1, 1, 1, 1), integer32()) if mibBuilder.loadTexts: copyConfigIndex.setStatus('current') if mibBuilder.loadTexts: copyConfigIndex.setDescription('To initiate a config copy request, user should assign a positive random value as an index. ') copy_src_file_type = mib_table_column((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 1, 1, 1, 2), dell_net_config_file_type()).setMaxAccess('readwrite') if mibBuilder.loadTexts: copySrcFileType.setStatus('current') if mibBuilder.loadTexts: copySrcFileType.setDescription('Specifies the type of file to copy from. if the copySrcFileType is runningConfig(2) or startupConfig(3), the default DellNetConfigFileLocation is flash(1). If the copySrcFileType has the value of dellNetFile(1), it is expected that the copySrcFileLocation and copySrcFileName must also be spcified. The three objects together will uniquely identify the source file. ') copy_src_file_location = mib_table_column((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 1, 1, 1, 3), dell_net_config_file_location()).setMaxAccess('readwrite') if mibBuilder.loadTexts: copySrcFileLocation.setStatus('current') if mibBuilder.loadTexts: copySrcFileLocation.setDescription('Specifies the location of source file. If the copySrcFileType has the value of dellNetFile(1), it is expected that the copySrcFileType and copySrcFileName must also be spcified. The three objects together will uniquely identify the source file. If the copySrcFileLocation has the value of ftp(4) or scp(5), it is expected the login information liked copyServerAddress, copyUserName, and copyUserPassword also be spcified. ') copy_src_file_name = mib_table_column((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 1, 1, 1, 4), display_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: copySrcFileName.setStatus('current') if mibBuilder.loadTexts: copySrcFileName.setDescription('The file name (including the path, if applicable) of the file. If copySourceFileType is set to runningConfig or startupConfig, copySrcFileName is not needed. ') copy_dest_file_type = mib_table_column((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 1, 1, 1, 5), dell_net_config_file_type()).setMaxAccess('readwrite') if mibBuilder.loadTexts: copyDestFileType.setStatus('current') if mibBuilder.loadTexts: copyDestFileType.setDescription('Specifies the type of file to copy to. if the copyDestFileType is runningConfig(2) or startupConfig(3), the default dellNetDestFileLocation is flash(1). If the copyDestFileType has the value of dellNetFile(1), it is expected that the copyDestFileLocation and copyDestFileName must also be spcified. The three objects together will uniquely identify the destination file. ') copy_dest_file_location = mib_table_column((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 1, 1, 1, 6), dell_net_config_file_location()).setMaxAccess('readwrite') if mibBuilder.loadTexts: copyDestFileLocation.setStatus('current') if mibBuilder.loadTexts: copyDestFileLocation.setDescription('Specifies the location of destination file. If the copyDestFileType has the value of dellNetFile(1), it is expected that the copyDestFileType and copyDestFileName must also be spcified. The three objects together will uniquely identify the destination file. If the copyDestFileLocation has the value of ftp(4) or scp(5), it is expected the login information liked copyServerAddress, copyUserName, and copyUserPassword also be spcified. ') copy_dest_file_name = mib_table_column((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 1, 1, 1, 7), display_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: copyDestFileName.setStatus('current') if mibBuilder.loadTexts: copyDestFileName.setDescription('Specifies the location of destination file. If the copyDestFileType has the value of dellNetFile(1), it is expected that the dellNetCopyDestFileTyp and copyDestFileLocation must also be spcified. The three objects together will uniquely identify the source file. If the copyDestFileLocation has the value of ftp(4) or scp(5), it is expected the login information liked copyServerAddress, copyUserName, and copyUserPassword also be spcified. ') copy_server_address = mib_table_column((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 1, 1, 1, 8), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: copyServerAddress.setStatus('deprecated') if mibBuilder.loadTexts: copyServerAddress.setDescription('The ip address of the tftp server from (or to) which to copy the configuration file. Values of 0.0.0.0 or FF.FF.FF.FF for copyServerAddress are not allowed. If the copyDestFileLocation has the value of ftp(4) or scp(5), it is expected the login information liked copyServerAddress, copyUserName, and copyUserPassword also be spcified. ') copy_user_name = mib_table_column((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 1, 1, 1, 9), display_string().subtype(subtypeSpec=value_size_constraint(1, 15))).setMaxAccess('readwrite') if mibBuilder.loadTexts: copyUserName.setStatus('current') if mibBuilder.loadTexts: copyUserName.setDescription('Remote user name for copy via ftp, or scp. If the copyDestFileLocation has the value of ftp(4) or scp(5), it is expected the login information liked copyServerAddress, copyUserName, and copyUserPassword also be spcified. ') copy_user_password = mib_table_column((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 1, 1, 1, 10), display_string().subtype(subtypeSpec=value_size_constraint(1, 15))).setMaxAccess('readwrite') if mibBuilder.loadTexts: copyUserPassword.setStatus('current') if mibBuilder.loadTexts: copyUserPassword.setDescription('Password used by ftp, scp for copying a file to an ftp/scp server. If the copyDestFileLocation has the value of ftp(4) or scp(5), it is expected the login information liked copyServerAddress, copyUserName, and copyUserPassword also be spcified. ') copy_state = mib_table_column((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 1, 1, 1, 11), dell_net_config_copy_state()).setMaxAccess('readonly') if mibBuilder.loadTexts: copyState.setStatus('current') if mibBuilder.loadTexts: copyState.setDescription(' The state of config-copy operation. ') copy_time_started = mib_table_column((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 1, 1, 1, 12), time_ticks()).setMaxAccess('readonly') if mibBuilder.loadTexts: copyTimeStarted.setStatus('current') if mibBuilder.loadTexts: copyTimeStarted.setDescription(' The timetick when the copy started. ') copy_time_completed = mib_table_column((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 1, 1, 1, 13), time_ticks()).setMaxAccess('readonly') if mibBuilder.loadTexts: copyTimeCompleted.setStatus('current') if mibBuilder.loadTexts: copyTimeCompleted.setDescription(' The timetick when the copy completed. ') copy_fail_cause = mib_table_column((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 1, 1, 1, 14), dell_net_config_copy_fail_cause()).setMaxAccess('readonly') if mibBuilder.loadTexts: copyFailCause.setStatus('current') if mibBuilder.loadTexts: copyFailCause.setDescription(' The reason a config-copy request failed. ') copy_entry_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 1, 1, 1, 15), row_status()).setMaxAccess('readwrite') if mibBuilder.loadTexts: copyEntryRowStatus.setStatus('current') if mibBuilder.loadTexts: copyEntryRowStatus.setDescription(' The state of the copy operation. Uses CreateAndGo when you are performing the copy. The state is set to active when the copy is completed. ') copy_server_inet_address_type = mib_table_column((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 1, 1, 1, 16), inet_address_type()).setMaxAccess('readwrite') if mibBuilder.loadTexts: copyServerInetAddressType.setStatus('current') if mibBuilder.loadTexts: copyServerInetAddressType.setDescription(' The address type of copyServerInetAddress. Only ipv4 (1), ipv6 (2) and dns (16) types are supported. ') copy_server_inet_address = mib_table_column((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 1, 1, 1, 17), inet_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: copyServerInetAddress.setStatus('current') if mibBuilder.loadTexts: copyServerInetAddress.setDescription(' The IP address of the address ftp/tftp/scp server from or to which to copy the configuration file. If the copyDestFileLocation has the value of ftp(4) or scp(5), it is expected the login information copyUserName and copyUserPassword also be spcified. ') copy_alarm_mib_notifications = mib_identifier((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 2, 0)) copy_alarm_variable = mib_identifier((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 2, 1)) copy_alarm_level = mib_scalar((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 2, 1, 1), integer32()).setMaxAccess('accessiblefornotify') if mibBuilder.loadTexts: copyAlarmLevel.setStatus('current') if mibBuilder.loadTexts: copyAlarmLevel.setDescription('the message warning level') copy_alarm_string = mib_scalar((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 2, 1, 2), octet_string()).setMaxAccess('accessiblefornotify') if mibBuilder.loadTexts: copyAlarmString.setStatus('current') if mibBuilder.loadTexts: copyAlarmString.setDescription('An generic string value in the TRAP object') copy_alarm_index = mib_scalar((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 2, 1, 3), integer32()).setMaxAccess('accessiblefornotify') if mibBuilder.loadTexts: copyAlarmIndex.setStatus('current') if mibBuilder.loadTexts: copyAlarmIndex.setDescription("the index of the current copy. Indicates the index of the current copy, i.e. copyConfigIndex of dellNetCopyTable. Set to '-1' if copy executed by CLI") copy_config_completed = notification_type((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 2, 0, 1)).setObjects(('DELL-NETWORKING-COPY-CONFIG-MIB', 'copyAlarmLevel'), ('DELL-NETWORKING-COPY-CONFIG-MIB', 'copyAlarmString'), ('DELL-NETWORKING-COPY-CONFIG-MIB', 'copyAlarmIndex')) if mibBuilder.loadTexts: copyConfigCompleted.setStatus('current') if mibBuilder.loadTexts: copyConfigCompleted.setDescription('The agent generate this trap when a copy operational is completed.') config_conflict = notification_type((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 2, 0, 2)).setObjects(('DELL-NETWORKING-COPY-CONFIG-MIB', 'copyAlarmLevel'), ('DELL-NETWORKING-COPY-CONFIG-MIB', 'copyAlarmString'), ('DELL-NETWORKING-COPY-CONFIG-MIB', 'copyAlarmIndex')) if mibBuilder.loadTexts: configConflict.setStatus('current') if mibBuilder.loadTexts: configConflict.setDescription('The agent generate this trap when a configuration conflict found during audit.') config_conflict_clear = notification_type((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 2, 0, 3)).setObjects(('DELL-NETWORKING-COPY-CONFIG-MIB', 'copyAlarmLevel'), ('DELL-NETWORKING-COPY-CONFIG-MIB', 'copyAlarmString'), ('DELL-NETWORKING-COPY-CONFIG-MIB', 'copyAlarmIndex')) if mibBuilder.loadTexts: configConflictClear.setStatus('current') if mibBuilder.loadTexts: configConflictClear.setDescription('The agent generate this trap when a configuration conflict resolved during audit.') batch_config_commit_progress = notification_type((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 2, 0, 4)).setObjects(('DELL-NETWORKING-COPY-CONFIG-MIB', 'copyAlarmLevel'), ('DELL-NETWORKING-COPY-CONFIG-MIB', 'copyAlarmString'), ('DELL-NETWORKING-COPY-CONFIG-MIB', 'copyAlarmIndex')) if mibBuilder.loadTexts: batchConfigCommitProgress.setStatus('current') if mibBuilder.loadTexts: batchConfigCommitProgress.setDescription('The agent generate this trap when a configuration commit is initiated.') batch_config_commit_completed = notification_type((1, 3, 6, 1, 4, 1, 6027, 3, 5, 1, 2, 0, 5)).setObjects(('DELL-NETWORKING-COPY-CONFIG-MIB', 'copyAlarmLevel'), ('DELL-NETWORKING-COPY-CONFIG-MIB', 'copyAlarmString'), ('DELL-NETWORKING-COPY-CONFIG-MIB', 'copyAlarmIndex')) if mibBuilder.loadTexts: batchConfigCommitCompleted.setStatus('current') if mibBuilder.loadTexts: batchConfigCommitCompleted.setDescription('The agent generate this trap when a configuration commit is completed.') mibBuilder.exportSymbols('DELL-NETWORKING-COPY-CONFIG-MIB', dellNetCopyConfigTraps=dellNetCopyConfigTraps, dellNetCopyConfig=dellNetCopyConfig, DellNetConfigFileType=DellNetConfigFileType, copyAlarmMibNotifications=copyAlarmMibNotifications, copyAlarmLevel=copyAlarmLevel, dellNetCopyConfigMib=dellNetCopyConfigMib, copyFailCause=copyFailCause, copyDestFileName=copyDestFileName, copyServerInetAddressType=copyServerInetAddressType, DellNetConfigFileLocation=DellNetConfigFileLocation, copyTimeStarted=copyTimeStarted, copySrcFileLocation=copySrcFileLocation, copyDestFileLocation=copyDestFileLocation, copyState=copyState, copySrcFileType=copySrcFileType, copyConfigCompleted=copyConfigCompleted, copyUserPassword=copyUserPassword, batchConfigCommitProgress=batchConfigCommitProgress, dellNetCopyConfigObjects=dellNetCopyConfigObjects, DellNetConfigCopyState=DellNetConfigCopyState, copyConfigIndex=copyConfigIndex, copyServerInetAddress=copyServerInetAddress, DellNetConfigCopyFailCause=DellNetConfigCopyFailCause, dellNetCopyEntry=dellNetCopyEntry, copyDestFileType=copyDestFileType, copyAlarmVariable=copyAlarmVariable, copyServerAddress=copyServerAddress, batchConfigCommitCompleted=batchConfigCommitCompleted, copyAlarmIndex=copyAlarmIndex, copySrcFileName=copySrcFileName, PYSNMP_MODULE_ID=dellNetCopyConfigMib, copyTimeCompleted=copyTimeCompleted, configConflict=configConflict, configConflictClear=configConflictClear, copyUserName=copyUserName, dellNetCopyTable=dellNetCopyTable, copyAlarmString=copyAlarmString, copyEntryRowStatus=copyEntryRowStatus)
text = input() first = "AB" second = "BA" flag = False while True: if text.find(first) != -1: text = text[text.find(first)+2:] elif text.find(second) != -1: text = text[text.find(second)+2:] else: break if len(text) == 0: flag = True break if flag == True: print("YES") else: print("NO")
text = input() first = 'AB' second = 'BA' flag = False while True: if text.find(first) != -1: text = text[text.find(first) + 2:] elif text.find(second) != -1: text = text[text.find(second) + 2:] else: break if len(text) == 0: flag = True break if flag == True: print('YES') else: print('NO')
routes = { '{"command": "devs"}' : {"STATUS":[{"STATUS":"S","When":1553528607,"Code":9,"Msg":"3 GPU(s)","Description":"sgminer 5.6.2-b"}],"DEVS":[{"ASC":0,"Name":"BKLU","ID":0,"Enabled":"Y","Status":"Alive","Temperature":43.00,"MHS av":14131.4720,"MHS 5s":14130.6009,"Accepted":11788,"Rejected":9,"Hardware Errors":0,"Utility":2.9159,"Last Share Pool":0,"Last Share Time":1553528606,"Total MH":3427718036.9040,"Diff1 Work":224456704.000000,"Difficulty Accepted":195866624.00000000,"Difficulty Rejected":147456.00000000,"Last Share Difficulty":16384.00000000,"No Device":False,"Last Valid Work":1553528606,"Device Hardware%":0.0000,"Device Rejected%":0.0657,"Device Elapsed":242559},{"ASC":1,"Name":"BKLU","ID":1,"Enabled":"Y","Status":"Alive","Temperature":42.00,"MHS av":14131.4689,"MHS 5s":14131.1408,"Accepted":11757,"Rejected":10,"Hardware Errors":0,"Utility":2.9082,"Last Share Pool":0,"Last Share Time":1553528603,"Total MH":3427717273.8192,"Diff1 Work":223334400.000000,"Difficulty Accepted":195428352.00000000,"Difficulty Rejected":163840.00000000,"Last Share Difficulty":16384.00000000,"No Device":False,"Last Valid Work":1553528603,"Device Hardware%":0.0000,"Device Rejected%":0.0734,"Device Elapsed":242559},{"ASC":2,"Name":"BKLU","ID":2,"Enabled":"Y","Status":"Alive","Temperature":39.00,"MHS av":14131.4688,"MHS 5s":14131.2909,"Accepted":11570,"Rejected":12,"Hardware Errors":0,"Utility":2.8620,"Last Share Pool":0,"Last Share Time":1553528605,"Total MH":3427717259.6881,"Diff1 Work":219270144.000000,"Difficulty Accepted":191811584.00000000,"Difficulty Rejected":196608.00000000,"Last Share Difficulty":16384.00000000,"No Device":False,"Last Valid Work":1553528605,"Device Hardware%":0.0000,"Device Rejected%":0.0897,"Device Elapsed":242559}],"id":1}, '{"command": "pools"}' : {"STATUS":[{"STATUS":"S","When":1553528611,"Code":7,"Msg":"6 Pool(s)","Description":"sgminer 5.6.2-b"}],"POOLS":[{"POOL":0,"Name":"lbry.usa.nicehash.com","URL":"stratum+tcp://lbry.usa.nicehash.com:3356","Profile":"","Algorithm":"lbry","Algorithm Type":"Lbry","Description":"","Status":"Alive","Priority":0,"Quota":1,"Long Poll":"N","Getworks":7014,"Accepted":35115,"Rejected":31,"Works":3931179,"Discarded":135670,"Stale":5043,"Get Failures":0,"Remote Failures":0,"User":"3J6HNskoH271PVPFvfAmBqUmarMFjwwfCX.1","Last Share Time":1553528606,"Diff1 Shares":667061248.000000,"Proxy Type":"","Proxy":"","Difficulty Accepted":583106560.00000000,"Difficulty Rejected":507904.00000000,"Difficulty Stale":83446784.00000000,"Last Share Difficulty":16384.00000000,"Has Stratum":True,"Stratum Active":True,"Stratum URL":"lbry.usa.nicehash.com","Has GBT":False,"Best Share":1286062923.914351,"Pool Rejected%":0.0761,"Pool Stale%":12.5096},{"POOL":1,"Name":"decred.usa.nicehash.com","URL":"stratum+tcp://decred.usa.nicehash.com:3354","Profile":"","Algorithm":"decred","Algorithm Type":"Decred","Description":"","Status":"Alive","Priority":1,"Quota":1,"Long Poll":"N","Getworks":0,"Accepted":0,"Rejected":0,"Works":0,"Discarded":0,"Stale":0,"Get Failures":0,"Remote Failures":0,"User":"3J6HNskoH271PVPFvfAmBqUmarMFjwwfCX.1","Last Share Time":0,"Diff1 Shares":0.000000,"Proxy Type":"","Proxy":"","Difficulty Accepted":0.00000000,"Difficulty Rejected":0.00000000,"Difficulty Stale":0.00000000,"Last Share Difficulty":0.00000000,"Has Stratum":True,"Stratum Active":False,"Stratum URL":"","Has GBT":False,"Best Share":0.000000,"Pool Rejected%":0.0000,"Pool Stale%":0.0000},{"POOL":2,"Name":"blake256r14.usa.nicehash.com","URL":"stratum+tcp://blake256r14.usa.nicehash.com:3350","Profile":"","Algorithm":"blake256r14","Algorithm Type":"Blake","Description":"","Status":"Dead","Priority":1,"Quota":1,"Long Poll":"N","Getworks":0,"Accepted":0,"Rejected":0,"Works":0,"Discarded":0,"Stale":0,"Get Failures":0,"Remote Failures":0,"User":"3J6HNskoH271PVPFvfAmBqUmarMFjwwfCX.1","Last Share Time":0,"Diff1 Shares":0.000000,"Proxy Type":"","Proxy":"","Difficulty Accepted":0.00000000,"Difficulty Rejected":0.00000000,"Difficulty Stale":0.00000000,"Last Share Difficulty":0.00000000,"Has Stratum":True,"Stratum Active":False,"Stratum URL":"","Has GBT":False,"Best Share":0.000000,"Pool Rejected%":0.0000,"Pool Stale%":0.0000},{"POOL":3,"Name":"blake256r8.usa.nicehash.com","URL":"stratum+tcp://blake256r8.usa.nicehash.com:3349","Profile":"","Algorithm":"blake256r8","Algorithm Type":"Blakecoin","Description":"","Status":"Alive","Priority":1,"Quota":1,"Long Poll":"N","Getworks":0,"Accepted":0,"Rejected":0,"Works":0,"Discarded":0,"Stale":0,"Get Failures":0,"Remote Failures":0,"User":"3J6HNskoH271PVPFvfAmBqUmarMFjwwfCX.1","Last Share Time":0,"Diff1 Shares":0.000000,"Proxy Type":"","Proxy":"","Difficulty Accepted":0.00000000,"Difficulty Rejected":0.00000000,"Difficulty Stale":0.00000000,"Last Share Difficulty":0.00000000,"Has Stratum":True,"Stratum Active":False,"Stratum URL":"","Has GBT":False,"Best Share":0.000000,"Pool Rejected%":0.0000,"Pool Stale%":0.0000},{"POOL":4,"Name":"pascal.usa.nicehash.com","URL":"stratum+tcp://pascal.usa.nicehash.com:3358","Profile":"","Algorithm":"pascal","Algorithm Type":"Pascal","Description":"","Status":"Alive","Priority":1,"Quota":1,"Long Poll":"N","Getworks":0,"Accepted":0,"Rejected":0,"Works":0,"Discarded":0,"Stale":0,"Get Failures":0,"Remote Failures":0,"User":"3J6HNskoH271PVPFvfAmBqUmarMFjwwfCX.1","Last Share Time":0,"Diff1 Shares":0.000000,"Proxy Type":"","Proxy":"","Difficulty Accepted":0.00000000,"Difficulty Rejected":0.00000000,"Difficulty Stale":0.00000000,"Last Share Difficulty":0.00000000,"Has Stratum":True,"Stratum Active":False,"Stratum URL":"","Has GBT":False,"Best Share":0.000000,"Pool Rejected%":0.0000,"Pool Stale%":0.0000},{"POOL":5,"Name":"sia.usa.nicehash.com","URL":"stratum+tcp://sia.usa.nicehash.com:3360","Profile":"","Algorithm":"sia","Algorithm Type":"Sia","Description":"","Status":"Alive","Priority":2,"Quota":1,"Long Poll":"N","Getworks":0,"Accepted":0,"Rejected":0,"Works":0,"Discarded":0,"Stale":0,"Get Failures":0,"Remote Failures":0,"User":"3J6HNskoH271PVPFvfAmBqUmarMFjwwfCX.1","Last Share Time":0,"Diff1 Shares":0.000000,"Proxy Type":"","Proxy":"","Difficulty Accepted":0.00000000,"Difficulty Rejected":0.00000000,"Difficulty Stale":0.00000000,"Last Share Difficulty":0.00000000,"Has Stratum":True,"Stratum Active":False,"Stratum URL":"","Has GBT":False,"Best Share":0.000000,"Pool Rejected%":0.0000,"Pool Stale%":0.0000}],"id":1}, '{"command": "summary"}' : {"STATUS":[{"STATUS":"S","When":1553528611,"Code":11,"Msg":"Summary","Description":"sgminer 5.6.2-b"}],"SUMMARY":[{"Elapsed":242564,"MHS av":42394.3021,"MHS 5s":42383.2910,"KHS av":42394302,"KHS 5s":42383291,"Found Blocks":3995,"Getworks":7014,"Accepted":35115,"Rejected":31,"Hardware Errors":0,"Utility":8.6859,"Discarded":135670,"Stale":5043,"Get Failures":0,"Local Work":4072753,"Remote Failures":0,"Network Blocks":1548,"Total MH":10283339200.9091,"Work Utility":165002.4113,"Difficulty Accepted":583106560.00000000,"Difficulty Rejected":507904.00000000,"Difficulty Stale":83446784.00000000,"Best Share":1286062923.914351,"Device Hardware%":0.0000,"Device Rejected%":0.0761,"Pool Rejected%":0.0761,"Pool Stale%":12.5096,"Last getwork":1553528611}],"id":1} }
routes = {'{"command": "devs"}': {'STATUS': [{'STATUS': 'S', 'When': 1553528607, 'Code': 9, 'Msg': '3 GPU(s)', 'Description': 'sgminer 5.6.2-b'}], 'DEVS': [{'ASC': 0, 'Name': 'BKLU', 'ID': 0, 'Enabled': 'Y', 'Status': 'Alive', 'Temperature': 43.0, 'MHS av': 14131.472, 'MHS 5s': 14130.6009, 'Accepted': 11788, 'Rejected': 9, 'Hardware Errors': 0, 'Utility': 2.9159, 'Last Share Pool': 0, 'Last Share Time': 1553528606, 'Total MH': 3427718036.904, 'Diff1 Work': 224456704.0, 'Difficulty Accepted': 195866624.0, 'Difficulty Rejected': 147456.0, 'Last Share Difficulty': 16384.0, 'No Device': False, 'Last Valid Work': 1553528606, 'Device Hardware%': 0.0, 'Device Rejected%': 0.0657, 'Device Elapsed': 242559}, {'ASC': 1, 'Name': 'BKLU', 'ID': 1, 'Enabled': 'Y', 'Status': 'Alive', 'Temperature': 42.0, 'MHS av': 14131.4689, 'MHS 5s': 14131.1408, 'Accepted': 11757, 'Rejected': 10, 'Hardware Errors': 0, 'Utility': 2.9082, 'Last Share Pool': 0, 'Last Share Time': 1553528603, 'Total MH': 3427717273.8192, 'Diff1 Work': 223334400.0, 'Difficulty Accepted': 195428352.0, 'Difficulty Rejected': 163840.0, 'Last Share Difficulty': 16384.0, 'No Device': False, 'Last Valid Work': 1553528603, 'Device Hardware%': 0.0, 'Device Rejected%': 0.0734, 'Device Elapsed': 242559}, {'ASC': 2, 'Name': 'BKLU', 'ID': 2, 'Enabled': 'Y', 'Status': 'Alive', 'Temperature': 39.0, 'MHS av': 14131.4688, 'MHS 5s': 14131.2909, 'Accepted': 11570, 'Rejected': 12, 'Hardware Errors': 0, 'Utility': 2.862, 'Last Share Pool': 0, 'Last Share Time': 1553528605, 'Total MH': 3427717259.6881, 'Diff1 Work': 219270144.0, 'Difficulty Accepted': 191811584.0, 'Difficulty Rejected': 196608.0, 'Last Share Difficulty': 16384.0, 'No Device': False, 'Last Valid Work': 1553528605, 'Device Hardware%': 0.0, 'Device Rejected%': 0.0897, 'Device Elapsed': 242559}], 'id': 1}, '{"command": "pools"}': {'STATUS': [{'STATUS': 'S', 'When': 1553528611, 'Code': 7, 'Msg': '6 Pool(s)', 'Description': 'sgminer 5.6.2-b'}], 'POOLS': [{'POOL': 0, 'Name': 'lbry.usa.nicehash.com', 'URL': 'stratum+tcp://lbry.usa.nicehash.com:3356', 'Profile': '', 'Algorithm': 'lbry', 'Algorithm Type': 'Lbry', 'Description': '', 'Status': 'Alive', 'Priority': 0, 'Quota': 1, 'Long Poll': 'N', 'Getworks': 7014, 'Accepted': 35115, 'Rejected': 31, 'Works': 3931179, 'Discarded': 135670, 'Stale': 5043, 'Get Failures': 0, 'Remote Failures': 0, 'User': '3J6HNskoH271PVPFvfAmBqUmarMFjwwfCX.1', 'Last Share Time': 1553528606, 'Diff1 Shares': 667061248.0, 'Proxy Type': '', 'Proxy': '', 'Difficulty Accepted': 583106560.0, 'Difficulty Rejected': 507904.0, 'Difficulty Stale': 83446784.0, 'Last Share Difficulty': 16384.0, 'Has Stratum': True, 'Stratum Active': True, 'Stratum URL': 'lbry.usa.nicehash.com', 'Has GBT': False, 'Best Share': 1286062923.914351, 'Pool Rejected%': 0.0761, 'Pool Stale%': 12.5096}, {'POOL': 1, 'Name': 'decred.usa.nicehash.com', 'URL': 'stratum+tcp://decred.usa.nicehash.com:3354', 'Profile': '', 'Algorithm': 'decred', 'Algorithm Type': 'Decred', 'Description': '', 'Status': 'Alive', 'Priority': 1, 'Quota': 1, 'Long Poll': 'N', 'Getworks': 0, 'Accepted': 0, 'Rejected': 0, 'Works': 0, 'Discarded': 0, 'Stale': 0, 'Get Failures': 0, 'Remote Failures': 0, 'User': '3J6HNskoH271PVPFvfAmBqUmarMFjwwfCX.1', 'Last Share Time': 0, 'Diff1 Shares': 0.0, 'Proxy Type': '', 'Proxy': '', 'Difficulty Accepted': 0.0, 'Difficulty Rejected': 0.0, 'Difficulty Stale': 0.0, 'Last Share Difficulty': 0.0, 'Has Stratum': True, 'Stratum Active': False, 'Stratum URL': '', 'Has GBT': False, 'Best Share': 0.0, 'Pool Rejected%': 0.0, 'Pool Stale%': 0.0}, {'POOL': 2, 'Name': 'blake256r14.usa.nicehash.com', 'URL': 'stratum+tcp://blake256r14.usa.nicehash.com:3350', 'Profile': '', 'Algorithm': 'blake256r14', 'Algorithm Type': 'Blake', 'Description': '', 'Status': 'Dead', 'Priority': 1, 'Quota': 1, 'Long Poll': 'N', 'Getworks': 0, 'Accepted': 0, 'Rejected': 0, 'Works': 0, 'Discarded': 0, 'Stale': 0, 'Get Failures': 0, 'Remote Failures': 0, 'User': '3J6HNskoH271PVPFvfAmBqUmarMFjwwfCX.1', 'Last Share Time': 0, 'Diff1 Shares': 0.0, 'Proxy Type': '', 'Proxy': '', 'Difficulty Accepted': 0.0, 'Difficulty Rejected': 0.0, 'Difficulty Stale': 0.0, 'Last Share Difficulty': 0.0, 'Has Stratum': True, 'Stratum Active': False, 'Stratum URL': '', 'Has GBT': False, 'Best Share': 0.0, 'Pool Rejected%': 0.0, 'Pool Stale%': 0.0}, {'POOL': 3, 'Name': 'blake256r8.usa.nicehash.com', 'URL': 'stratum+tcp://blake256r8.usa.nicehash.com:3349', 'Profile': '', 'Algorithm': 'blake256r8', 'Algorithm Type': 'Blakecoin', 'Description': '', 'Status': 'Alive', 'Priority': 1, 'Quota': 1, 'Long Poll': 'N', 'Getworks': 0, 'Accepted': 0, 'Rejected': 0, 'Works': 0, 'Discarded': 0, 'Stale': 0, 'Get Failures': 0, 'Remote Failures': 0, 'User': '3J6HNskoH271PVPFvfAmBqUmarMFjwwfCX.1', 'Last Share Time': 0, 'Diff1 Shares': 0.0, 'Proxy Type': '', 'Proxy': '', 'Difficulty Accepted': 0.0, 'Difficulty Rejected': 0.0, 'Difficulty Stale': 0.0, 'Last Share Difficulty': 0.0, 'Has Stratum': True, 'Stratum Active': False, 'Stratum URL': '', 'Has GBT': False, 'Best Share': 0.0, 'Pool Rejected%': 0.0, 'Pool Stale%': 0.0}, {'POOL': 4, 'Name': 'pascal.usa.nicehash.com', 'URL': 'stratum+tcp://pascal.usa.nicehash.com:3358', 'Profile': '', 'Algorithm': 'pascal', 'Algorithm Type': 'Pascal', 'Description': '', 'Status': 'Alive', 'Priority': 1, 'Quota': 1, 'Long Poll': 'N', 'Getworks': 0, 'Accepted': 0, 'Rejected': 0, 'Works': 0, 'Discarded': 0, 'Stale': 0, 'Get Failures': 0, 'Remote Failures': 0, 'User': '3J6HNskoH271PVPFvfAmBqUmarMFjwwfCX.1', 'Last Share Time': 0, 'Diff1 Shares': 0.0, 'Proxy Type': '', 'Proxy': '', 'Difficulty Accepted': 0.0, 'Difficulty Rejected': 0.0, 'Difficulty Stale': 0.0, 'Last Share Difficulty': 0.0, 'Has Stratum': True, 'Stratum Active': False, 'Stratum URL': '', 'Has GBT': False, 'Best Share': 0.0, 'Pool Rejected%': 0.0, 'Pool Stale%': 0.0}, {'POOL': 5, 'Name': 'sia.usa.nicehash.com', 'URL': 'stratum+tcp://sia.usa.nicehash.com:3360', 'Profile': '', 'Algorithm': 'sia', 'Algorithm Type': 'Sia', 'Description': '', 'Status': 'Alive', 'Priority': 2, 'Quota': 1, 'Long Poll': 'N', 'Getworks': 0, 'Accepted': 0, 'Rejected': 0, 'Works': 0, 'Discarded': 0, 'Stale': 0, 'Get Failures': 0, 'Remote Failures': 0, 'User': '3J6HNskoH271PVPFvfAmBqUmarMFjwwfCX.1', 'Last Share Time': 0, 'Diff1 Shares': 0.0, 'Proxy Type': '', 'Proxy': '', 'Difficulty Accepted': 0.0, 'Difficulty Rejected': 0.0, 'Difficulty Stale': 0.0, 'Last Share Difficulty': 0.0, 'Has Stratum': True, 'Stratum Active': False, 'Stratum URL': '', 'Has GBT': False, 'Best Share': 0.0, 'Pool Rejected%': 0.0, 'Pool Stale%': 0.0}], 'id': 1}, '{"command": "summary"}': {'STATUS': [{'STATUS': 'S', 'When': 1553528611, 'Code': 11, 'Msg': 'Summary', 'Description': 'sgminer 5.6.2-b'}], 'SUMMARY': [{'Elapsed': 242564, 'MHS av': 42394.3021, 'MHS 5s': 42383.291, 'KHS av': 42394302, 'KHS 5s': 42383291, 'Found Blocks': 3995, 'Getworks': 7014, 'Accepted': 35115, 'Rejected': 31, 'Hardware Errors': 0, 'Utility': 8.6859, 'Discarded': 135670, 'Stale': 5043, 'Get Failures': 0, 'Local Work': 4072753, 'Remote Failures': 0, 'Network Blocks': 1548, 'Total MH': 10283339200.9091, 'Work Utility': 165002.4113, 'Difficulty Accepted': 583106560.0, 'Difficulty Rejected': 507904.0, 'Difficulty Stale': 83446784.0, 'Best Share': 1286062923.914351, 'Device Hardware%': 0.0, 'Device Rejected%': 0.0761, 'Pool Rejected%': 0.0761, 'Pool Stale%': 12.5096, 'Last getwork': 1553528611}], 'id': 1}}
TAG_ALBUM = "album" TAG_ALBUM_ARTIST = "album_artist" TAG_ARTIST = "artist" TAG_DURATION = "duration" TAG_GENRE = "genre" TAG_TITLE = "title" TAG_TRACK = "track" TAG_YEAR = "year" TAGS = frozenset([ TAG_ALBUM, TAG_ALBUM_ARTIST, TAG_ARTIST, TAG_DURATION, TAG_GENRE, TAG_TITLE, TAG_TRACK, TAG_YEAR, ])
tag_album = 'album' tag_album_artist = 'album_artist' tag_artist = 'artist' tag_duration = 'duration' tag_genre = 'genre' tag_title = 'title' tag_track = 'track' tag_year = 'year' tags = frozenset([TAG_ALBUM, TAG_ALBUM_ARTIST, TAG_ARTIST, TAG_DURATION, TAG_GENRE, TAG_TITLE, TAG_TRACK, TAG_YEAR])
class Solution: def sortItems(self, n: int, m: int, group: List[int], beforeItems: List[List[int]]) -> List[int]: cnt = 0 groups = collections.defaultdict(list) for i, g in enumerate(group): if g == -1: group[i] = cnt + m cnt += 1 groups[group[i]].append(i) degrees = [0] * (m + cnt) graphs = collections.defaultdict(set) follows = collections.defaultdict(list) for v, befores in enumerate(beforeItems): for u in befores: if group[u] != group[v]: degrees[group[v]] += 1 follows[group[u]].append(group[v]) else: graphs[group[u]].add((u, v)) frees = [] for i in range(cnt + m): if degrees[i] == 0: frees.append(i) group_seq = [] while frees: node = frees.pop() group_seq.append(node) for nei in follows[node]: degrees[nei] -= 1 if degrees[nei] == 0: frees.append(nei) if len(group_seq) != m + cnt: return [] ans = [] for gidx in group_seq: if len(groups[gidx]) == 1: ans.append(groups[gidx].pop()) else: eles = groups[gidx] edges = graphs[gidx] degrees = {e : 0 for e in eles} follows = collections.defaultdict(set) for u, v in edges: degrees[v] += 1 follows[u].add(v) frees = [] for e in eles: if degrees[e] == 0: frees.append(e) seq = [] while frees: node = frees.pop() seq.append(node) for nei in follows[node]: degrees[nei] -= 1 if degrees[nei] == 0: frees.append(nei) if len(seq) == len(eles): ans.extend(seq) else: return [] return ans
class Solution: def sort_items(self, n: int, m: int, group: List[int], beforeItems: List[List[int]]) -> List[int]: cnt = 0 groups = collections.defaultdict(list) for (i, g) in enumerate(group): if g == -1: group[i] = cnt + m cnt += 1 groups[group[i]].append(i) degrees = [0] * (m + cnt) graphs = collections.defaultdict(set) follows = collections.defaultdict(list) for (v, befores) in enumerate(beforeItems): for u in befores: if group[u] != group[v]: degrees[group[v]] += 1 follows[group[u]].append(group[v]) else: graphs[group[u]].add((u, v)) frees = [] for i in range(cnt + m): if degrees[i] == 0: frees.append(i) group_seq = [] while frees: node = frees.pop() group_seq.append(node) for nei in follows[node]: degrees[nei] -= 1 if degrees[nei] == 0: frees.append(nei) if len(group_seq) != m + cnt: return [] ans = [] for gidx in group_seq: if len(groups[gidx]) == 1: ans.append(groups[gidx].pop()) else: eles = groups[gidx] edges = graphs[gidx] degrees = {e: 0 for e in eles} follows = collections.defaultdict(set) for (u, v) in edges: degrees[v] += 1 follows[u].add(v) frees = [] for e in eles: if degrees[e] == 0: frees.append(e) seq = [] while frees: node = frees.pop() seq.append(node) for nei in follows[node]: degrees[nei] -= 1 if degrees[nei] == 0: frees.append(nei) if len(seq) == len(eles): ans.extend(seq) else: return [] return ans
description = 'NICOS demo startup setup' group = 'lowlevel' # startupcode = ''' # printinfo("============================================================") # printinfo("Welcome to the NICOS demo.") # printinfo("Run one of the following commands to set up either a triple-axis") # printinfo("or a SANS demo setup:") # printinfo(" > NewSetup('tas')") # printinfo(" > NewSetup('sans')") # '''
description = 'NICOS demo startup setup' group = 'lowlevel'
#!/usr/bin/env python class Life: def __init__(self, name='unknown'): print('Hello ' + name) self.name = name def live(self): print(self.name) def __del__(self): print('Goodbye ' + self.name) brian = Life('Brian') brian.live() brian = 'leretta'
class Life: def __init__(self, name='unknown'): print('Hello ' + name) self.name = name def live(self): print(self.name) def __del__(self): print('Goodbye ' + self.name) brian = life('Brian') brian.live() brian = 'leretta'
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. { 'variables': { 'lzma_sdk_sources': [ '7z.h', '7zAlloc.c', '7zAlloc.h', '7zArcIn.c', '7zBuf.c', '7zBuf.h', '7zCrc.c', '7zCrc.h', '7zCrcOpt.c', '7zDec.c', '7zFile.c', '7zFile.h', '7zStream.c', '7zTypes.h', 'Alloc.c', 'Alloc.h', 'Bcj2.c', 'Bcj2.h', 'Bra.c', 'Bra.h', 'Bra86.c', 'Compiler.h', 'CpuArch.c', 'CpuArch.h', 'Delta.c', 'Delta.h', 'LzFind.c', 'LzFind.h', 'LzHash.h', 'Lzma2Dec.c', 'Lzma2Dec.h', 'LzmaEnc.c', 'LzmaEnc.h', 'LzmaDec.c', 'LzmaDec.h', 'LzmaLib.c', 'LzmaLib.h', 'Precomp.h', ], }, 'targets': [ { 'target_name': 'lzma_sdk', 'type': 'static_library', 'defines': [ '_7ZIP_ST', '_7Z_NO_METHODS_FILTERS', '_LZMA_PROB32', ], 'variables': { # Upstream uses self-assignment to avoid warnings. 'clang_warning_flags': [ '-Wno-self-assign' ] }, 'sources': [ '<@(lzma_sdk_sources)', ], 'include_dirs': [ '.', ], 'direct_dependent_settings': { 'include_dirs': [ '.', ], }, }, ], 'conditions': [ ['OS=="win"', { 'targets': [ { 'target_name': 'lzma_sdk64', 'type': 'static_library', 'defines': [ '_7ZIP_ST', '_LZMA_PROB32', ], 'variables': { # Upstream uses self-assignment to avoid warnings. 'clang_warning_flags': [ '-Wno-self-assign' ] }, 'include_dirs': [ '.', ], 'sources': [ '<@(lzma_sdk_sources)', ], 'configurations': { 'Common_Base': { 'msvs_target_platform': 'x64', }, }, 'direct_dependent_settings': { 'include_dirs': [ '.', ], }, }, ], }], ], }
{'variables': {'lzma_sdk_sources': ['7z.h', '7zAlloc.c', '7zAlloc.h', '7zArcIn.c', '7zBuf.c', '7zBuf.h', '7zCrc.c', '7zCrc.h', '7zCrcOpt.c', '7zDec.c', '7zFile.c', '7zFile.h', '7zStream.c', '7zTypes.h', 'Alloc.c', 'Alloc.h', 'Bcj2.c', 'Bcj2.h', 'Bra.c', 'Bra.h', 'Bra86.c', 'Compiler.h', 'CpuArch.c', 'CpuArch.h', 'Delta.c', 'Delta.h', 'LzFind.c', 'LzFind.h', 'LzHash.h', 'Lzma2Dec.c', 'Lzma2Dec.h', 'LzmaEnc.c', 'LzmaEnc.h', 'LzmaDec.c', 'LzmaDec.h', 'LzmaLib.c', 'LzmaLib.h', 'Precomp.h']}, 'targets': [{'target_name': 'lzma_sdk', 'type': 'static_library', 'defines': ['_7ZIP_ST', '_7Z_NO_METHODS_FILTERS', '_LZMA_PROB32'], 'variables': {'clang_warning_flags': ['-Wno-self-assign']}, 'sources': ['<@(lzma_sdk_sources)'], 'include_dirs': ['.'], 'direct_dependent_settings': {'include_dirs': ['.']}}], 'conditions': [['OS=="win"', {'targets': [{'target_name': 'lzma_sdk64', 'type': 'static_library', 'defines': ['_7ZIP_ST', '_LZMA_PROB32'], 'variables': {'clang_warning_flags': ['-Wno-self-assign']}, 'include_dirs': ['.'], 'sources': ['<@(lzma_sdk_sources)'], 'configurations': {'Common_Base': {'msvs_target_platform': 'x64'}}, 'direct_dependent_settings': {'include_dirs': ['.']}}]}]]}
config = { 'sampling_rate': 22050, 'hop_size': 256, 'model_type': 'hifigan_generator', 'hifigan_generator_params': { 'out_channels': 1, 'kernel_size': 7, 'filters': 128, 'use_bias': True, 'upsample_scales': [8, 8, 2, 2], 'stacks': 3, 'stack_kernel_size': [3, 7, 11], 'stack_dilation_rate': [[1, 3, 5], [1, 3, 5], [1, 3, 5]], 'use_final_nolinear_activation': True, 'is_weight_norm': False, }, 'hifigan_discriminator_params': { 'out_channels': 1, 'period_scales': [2, 3, 5, 7, 11], 'n_layers': 5, 'kernel_size': 5, 'strides': 3, 'filters': 8, 'filter_scales': 4, 'max_filters': 512, 'is_weight_norm': False, }, 'melgan_discriminator_params': { 'out_channels': 1, 'scales': 3, 'downsample_pooling': 'AveragePooling1D', 'downsample_pooling_params': {'pool_size': 4, 'strides': 2}, 'kernel_sizes': [5, 3], 'filters': 16, 'max_downsample_filters': 512, 'downsample_scales': [4, 4, 4, 4], 'nonlinear_activation': 'LeakyReLU', 'nonlinear_activation_params': {'alpha': 0.2}, 'is_weight_norm': False, }, 'stft_loss_params': { 'fft_lengths': [1024, 2048, 512], 'frame_steps': [120, 240, 50], 'frame_lengths': [600, 1200, 240], }, 'lambda_feat_match': 10.0, 'lambda_adv': 4.0, 'batch_size': 16, 'batch_max_steps': 8192, 'batch_max_steps_valid': 81920, 'remove_short_samples': True, 'allow_cache': True, 'is_shuffle': True, }
config = {'sampling_rate': 22050, 'hop_size': 256, 'model_type': 'hifigan_generator', 'hifigan_generator_params': {'out_channels': 1, 'kernel_size': 7, 'filters': 128, 'use_bias': True, 'upsample_scales': [8, 8, 2, 2], 'stacks': 3, 'stack_kernel_size': [3, 7, 11], 'stack_dilation_rate': [[1, 3, 5], [1, 3, 5], [1, 3, 5]], 'use_final_nolinear_activation': True, 'is_weight_norm': False}, 'hifigan_discriminator_params': {'out_channels': 1, 'period_scales': [2, 3, 5, 7, 11], 'n_layers': 5, 'kernel_size': 5, 'strides': 3, 'filters': 8, 'filter_scales': 4, 'max_filters': 512, 'is_weight_norm': False}, 'melgan_discriminator_params': {'out_channels': 1, 'scales': 3, 'downsample_pooling': 'AveragePooling1D', 'downsample_pooling_params': {'pool_size': 4, 'strides': 2}, 'kernel_sizes': [5, 3], 'filters': 16, 'max_downsample_filters': 512, 'downsample_scales': [4, 4, 4, 4], 'nonlinear_activation': 'LeakyReLU', 'nonlinear_activation_params': {'alpha': 0.2}, 'is_weight_norm': False}, 'stft_loss_params': {'fft_lengths': [1024, 2048, 512], 'frame_steps': [120, 240, 50], 'frame_lengths': [600, 1200, 240]}, 'lambda_feat_match': 10.0, 'lambda_adv': 4.0, 'batch_size': 16, 'batch_max_steps': 8192, 'batch_max_steps_valid': 81920, 'remove_short_samples': True, 'allow_cache': True, 'is_shuffle': True}
def countdown(num): print(num) if num == 0: return else: countdown(num - 1) if __name__ == "__main__": countdown(10)
def countdown(num): print(num) if num == 0: return else: countdown(num - 1) if __name__ == '__main__': countdown(10)
class LocationPathFormatError(Exception): pass class LocationStepFormatError(Exception): pass class NodenameFormatError(Exception): pass class PredicateFormatError(Exception): pass class PredicatesFormatError(Exception): pass
class Locationpathformaterror(Exception): pass class Locationstepformaterror(Exception): pass class Nodenameformaterror(Exception): pass class Predicateformaterror(Exception): pass class Predicatesformaterror(Exception): pass
burst_time=[] print("Enter the number of process: ") n=int(input()) print("Enter the burst time of the processes: \n") burst_time=list(map(int, input().split())) waiting_time=[] avg_waiting_time=0 turnaround_time=[] avg_turnaround_time=0 waiting_time.insert(0,0) turnaround_time.insert(0,burst_time[0]) for i in range(1,len(burst_time)): waiting_time.insert(i,waiting_time[i-1]+burst_time[i-1]) turnaround_time.insert(i,waiting_time[i]+burst_time[i]) avg_waiting_time+=waiting_time[i] avg_turnaround_time+=turnaround_time[i] avg_waiting_time=float(avg_waiting_time)/n avg_turnaround_time=float(avg_turnaround_time)/n print("\n") print("Process\t Burst Time\t Waiting Time\t Turn Around Time") for i in range(0,n): print(str(i)+"\t\t"+str(burst_time[i])+"\t\t"+str(waiting_time[i])+"\t\t"+str(turnaround_time[i])) print("\n") print("Average Waiting time is: "+str(avg_waiting_time)) print("Average Turn Arount Time is: "+str(avg_turnaround_time))
burst_time = [] print('Enter the number of process: ') n = int(input()) print('Enter the burst time of the processes: \n') burst_time = list(map(int, input().split())) waiting_time = [] avg_waiting_time = 0 turnaround_time = [] avg_turnaround_time = 0 waiting_time.insert(0, 0) turnaround_time.insert(0, burst_time[0]) for i in range(1, len(burst_time)): waiting_time.insert(i, waiting_time[i - 1] + burst_time[i - 1]) turnaround_time.insert(i, waiting_time[i] + burst_time[i]) avg_waiting_time += waiting_time[i] avg_turnaround_time += turnaround_time[i] avg_waiting_time = float(avg_waiting_time) / n avg_turnaround_time = float(avg_turnaround_time) / n print('\n') print('Process\t Burst Time\t Waiting Time\t Turn Around Time') for i in range(0, n): print(str(i) + '\t\t' + str(burst_time[i]) + '\t\t' + str(waiting_time[i]) + '\t\t' + str(turnaround_time[i])) print('\n') print('Average Waiting time is: ' + str(avg_waiting_time)) print('Average Turn Arount Time is: ' + str(avg_turnaround_time))
lista = [ [1,2,3,4,5,6,7,9,8,10], [1,3,3,4,5,6,7,8,9,10], [1,7,3,4,5,6,7,8,9,10], [1,2,3,4,5,6,7,8,9,10], [1,2,3,4,5,6,7,8,9,10], [1,2,3,4,5,6,7,8,9,10], [1,8,3,4,5,6,7,8,9,10], ] def verificar(lista): ls = lista for index_lista in lista: for aux in index_lista: contador = 0 for lista in index_lista: print(f'aux : {aux} lista: {lista}') if aux == lista: contador += 1 print('contaador ', contador) if contador == 2: ind = ls.index(index_lista) print(f'no index da lista numero {ind} o numero: {aux} se repete') return 0 # print(aux) #print('============') verificar(lista)
lista = [[1, 2, 3, 4, 5, 6, 7, 9, 8, 10], [1, 3, 3, 4, 5, 6, 7, 8, 9, 10], [1, 7, 3, 4, 5, 6, 7, 8, 9, 10], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [1, 8, 3, 4, 5, 6, 7, 8, 9, 10]] def verificar(lista): ls = lista for index_lista in lista: for aux in index_lista: contador = 0 for lista in index_lista: print(f'aux : {aux} lista: {lista}') if aux == lista: contador += 1 print('contaador ', contador) if contador == 2: ind = ls.index(index_lista) print(f'no index da lista numero {ind} o numero: {aux} se repete') return 0 verificar(lista)
# Problem0019 - Counting Sundays # # https: // github.com/agileshaw/Project-Euler def totalDays(month, year): month_list = [4, 6, 9, 11] if month == 2: if year % 400 == 0 or ((year % 4 == 0) and year % 100 != 0): return 29 else: return 28 elif month in month_list: return 30 return 31 if __name__ == "__main__": count = 0 weekday = 0 for year in range(1900, 2001): for month in range(1, 13): for day in range(1, totalDays(month, year)+1): weekday = (weekday + 1) % 7 if weekday == 0 and day == 1 and year != 1900: count += 1 print("The total number of Sundays is: %d" % count)
def total_days(month, year): month_list = [4, 6, 9, 11] if month == 2: if year % 400 == 0 or (year % 4 == 0 and year % 100 != 0): return 29 else: return 28 elif month in month_list: return 30 return 31 if __name__ == '__main__': count = 0 weekday = 0 for year in range(1900, 2001): for month in range(1, 13): for day in range(1, total_days(month, year) + 1): weekday = (weekday + 1) % 7 if weekday == 0 and day == 1 and (year != 1900): count += 1 print('The total number of Sundays is: %d' % count)
class CraftParser: @staticmethod def calculate_mass(craft_filepath: str, masses: dict) -> int: parts = [] craft_lines = [] with open(craft_filepath) as craft: craft_lines = [line.strip() for line in craft.readlines()] for index, line in enumerate(craft_lines): if "part = " in line: # Replacing period with underscore because in craft files some parts # are stored with periods even though their names in cfg files # use underscores partname = line.split()[2].split('_')[0].replace('.', '_') parts.append((partname, 1)) elif 'RESOURCE' in line: resourcename = craft_lines[index + 2].split()[2] amount = float(craft_lines[index + 3].split()[2]) parts.append((resourcename, amount)) mass = 0 for part in parts: mass += masses[part[0]] * part[1] return mass @staticmethod def calculate_mass_distribution_3d(craft_filepath: str, masses: dict): parts = [] craft_lines = [] with open(craft_filepath) as craft: craft_lines = [line.strip() for line in craft.readlines()] for index, line in enumerate(craft_lines): if line == "PART": # Replacing period with underscore because in craft files some parts # are stored with periods even though their names in cfg files # use underscores partname = craft_lines[index + 2].split()[2].split('_')[0].replace('.', '_') for i in range(3, 7): if "pos = " in craft_lines[index + i]: pos = [float(coord) for coord in craft_lines[index + i].split()[2].split(',')] break parts.append([masses[partname], pos]) elif 'RESOURCE' in line: resourcename = craft_lines[index + 2].split()[2] amount = float(craft_lines[index + 3].split()[2]) parts[-1][0] += amount * masses[resourcename] return parts
class Craftparser: @staticmethod def calculate_mass(craft_filepath: str, masses: dict) -> int: parts = [] craft_lines = [] with open(craft_filepath) as craft: craft_lines = [line.strip() for line in craft.readlines()] for (index, line) in enumerate(craft_lines): if 'part = ' in line: partname = line.split()[2].split('_')[0].replace('.', '_') parts.append((partname, 1)) elif 'RESOURCE' in line: resourcename = craft_lines[index + 2].split()[2] amount = float(craft_lines[index + 3].split()[2]) parts.append((resourcename, amount)) mass = 0 for part in parts: mass += masses[part[0]] * part[1] return mass @staticmethod def calculate_mass_distribution_3d(craft_filepath: str, masses: dict): parts = [] craft_lines = [] with open(craft_filepath) as craft: craft_lines = [line.strip() for line in craft.readlines()] for (index, line) in enumerate(craft_lines): if line == 'PART': partname = craft_lines[index + 2].split()[2].split('_')[0].replace('.', '_') for i in range(3, 7): if 'pos = ' in craft_lines[index + i]: pos = [float(coord) for coord in craft_lines[index + i].split()[2].split(',')] break parts.append([masses[partname], pos]) elif 'RESOURCE' in line: resourcename = craft_lines[index + 2].split()[2] amount = float(craft_lines[index + 3].split()[2]) parts[-1][0] += amount * masses[resourcename] return parts