content
stringlengths
7
1.05M
class DsapiParams: def __init__(self, limit=1, bundles = [], role=None, tenant=None, format = 'json'): self.limit = limit self.bundles = bundles self.role = role self.tenant = tenant self.format = format def formatForRequest(self): formattedString = '?' numParams = 0 if self.limit: formattedString += 'limit=' + str(self.limit) numParams += 1 if self.bundles: if numParams >= 1: formattedString += '&' formattedString += 'bundle=' + ','.join(self.bundles) if self.role: if numParams >= 1: formattedString += '&' formattedString += 'role=' + self.role if self.tenant: if numParams >= 1: formattedString += '&' formattedString += 'tenant=' + self.tenant if self.format: if numParams >= 1: formattedString += '&' formattedString += 'format=' + self.format return formattedString
def decode_flag(value, alphabet): # Construct inverse alphabet. map_inv = [0]*len(alphabet) for i in range(len(alphabet)): map_inv[alphabet[i]] = i # Apply. result = bytearray() for i in range(len(value)): c = value[i] if i % 2 == 1: c -= 1 cc = map_inv[c] result.append(cc) return result encoded_flag = b"UwHEpXTXskOHiHFHT9s:W:nHhQsH_tJXhQ8Pa8wm" alphabet = bytes.fromhex("000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c432e2f614741385777597533633a3b3c3d3e3f40324d2d7b4b74314e7a6445624248726778556b765271346636795b5c5d5e7360304c394a6f58506e6d70537d6968656a564f5f46375435515a49447c6c7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff") print(decode_flag(encoded_flag, alphabet).decode("utf-8"))
### ### Copyright (C) 2019-2022 Intel Corporation ### ### SPDX-License-Identifier: BSD-3-Clause ### subsampling = { "Y800" : ("YUV400", 8), "I420" : ("YUV420", 8), "NV12" : ("YUV420", 8), "YV12" : ("YUV420", 8), "P010" : ("YUV420", 10), "P012" : ("YUV420", 12), "I010" : ("YUV420", 10), "422H" : ("YUV422", 8), "422V" : ("YUV422", 8), "YUY2" : ("YUV422", 8), "Y210" : ("YUV422", 10), "Y212" : ("YUV422", 12), "444P" : ("YUV444", 8), "AYUV" : ("YUV444", 8), "VUYA" : ("YUV444", 8), "Y410" : ("YUV444", 10), "Y412" : ("YUV444", 12), } def match_best_format(fmt, choices): if fmt in choices: return fmt matches = set([k for k,v in subsampling.items() if v == subsampling[fmt]]) matches &= set(choices) if len(matches) == 0: return None return list(matches)[0] def get_bit_depth(fmt): if fmt in ["BGRA", "BGRX", "ARGB"]: return 8 return subsampling[fmt][1] class FormatMapper: def get_supported_format_map(self): raise NotImplementedError def get_supported_formats(self): return set(self.get_supported_format_map().keys()) def map_format(self, format): return self.get_supported_format_map().get(format, None) def map_best_hw_format(self, format, hwformats): return self.map_format( match_best_format( format, set(hwformats) & set(self.get_supported_formats())))
# Definition for a binary tree node. class TreeNode(object): def __init__(self, x): self.val = x self.left = None self.right = None class Solution(object): def maxDepth(self, root): """ :type root: TreeNode :rtype: int """ height_left = self.maxDepth(root.left) height_right = self.maxDepth(root.right) return 1 + max(height_left, height_right) if root else 0 def invertTree(self, root): if root: root.left = self.invertTree(root.right) root.right = self.invertTree(root.left) return root def isSameTree(self, p, q): if p is None and q is None: return True if p is not None and q is not None: c1 = p.val == q.val c2 = self.isSameTree(p.left, q.left) c3 = self.isSameTree(p.right, q.right) return c1 and c2 and c3 return False def levelOrder(self, root): """ :type root: TreeNode :rtype: List[List[int]] """ if not root: return [] res, st = [], [root] while st: res.append([node.val for node in st]) st = [child for node in st for child in ( node.left, node.right) if child] return res def inorderTraversal(self, root): """ :type root: TreeNode :rtype: List[int] """ return self.inorderTraversal(root.left) + [root.val] + self.inorderTraversal( root.right) if root else[]
class Matrix: def __init__(self, matrix_string): self.row_string = matrix_string.splitlines() self.matrix = [[int(num) for num in row.split()] for row in self.row_string] def row(self, index): return self.matrix[index -1] def column(self, index): return [row[index -1] for row in self.matrix]
""" Genre class """ class Genre(object): """ Represents a genre for MyMusic Key properties are: * `id` - ID of the artist (Amazon ASIN) * `name` - Artist name. * `coverUrl` - URL containing cover art for the artist. * `genre` - Genre of the album. * `rating` - Average review score (out of 5). * `trackCount` - Number of tracks. * `releaseDate` - UNIX timestamp of the original release date. * `tracks` - Iterable generator for the `Tracks` that make up this station. """ def __init__(self, am, data): """ Internal use only. :param am: AmazonMusic object, used to make API calls. :param data: JSON data structure for the artist, from Amazon Music. Supports `cirrus` formats for now """ self._am = am self.json = data if 'metadata' in data: self.trackCount = data['numTracks'] data = data['metadata'] self.json = data self.id = data['objectId'] self.coverUrl = data.get('albumCoverImageFull', data.get('albumCoverImageMedium')) self.name = data['primaryGenre'] else: self.id = 'MUSE NOT SUPPORTED' self.coverUrl = 'MUSE NOT SUPPORTED' self.name = 'MUSE NOT SUPPORTED' self.trackCount = 'MUSE NOT SUPPORTED'
""" Ejercicio 1 """ def isSquare(num): """" Devuelve verdadero si el número es un cuadrado, caso contrario devuelve falso """ start = 1 end = num while start <= end: mid = int(start + (end - start) / 2) square = mid * mid if square == num: return True if square > num: end = mid - 1 else: start = mid + 1 return False for i in range(26): res = isSquare(i) print(i, " es ", res)
class DataClassFile(): def functionName1(self): """ One Function (without parameters) with one test function (with single line comments) where the documentation had not been generated. """ say = "say" fu = "fu" return say + " " + fu
vel = int(input('digite a velocidade do carro:')) multa = (vel - 80)*7 if vel>80: print(f'MULTADO! você excedeu o limite permitido que é 80Km/h e vai pagar uma multa de {multa}')
class Solution(object): def myAtoi(self, _str): """ :type str: str :rtype: int """ valid = set(['1', '2', '3', '4', '5', '6', '7', '8', '9', '0']) signs = set(['-', '+']) ns = [] ss = _str.strip() if len(ss) == 0: return 0 for v in ss: if v in valid: ns.append(v) continue if v in signs and not len(ns): ns.append(v) continue break if not ns or (len(ns) == 1 and ns[0] in signs): return 0 r = int(''.join(ns)) if r < -2147483648: return -2147483648 if r > 2147483647: return 2147483647 return r def test_my_a_to_i(): s = Solution() assert 0 == s.myAtoi("0-1") assert 0 == s.myAtoi("+-2") assert 1 == s.myAtoi("+1") assert 0 == s.myAtoi("") assert 0 == s.myAtoi("-") assert 42 == s.myAtoi("42") assert -42 == s.myAtoi(" -42") assert 4193 == s.myAtoi("4193 with words") assert 0 == s.myAtoi("words and 987") assert -2147483648 == s.myAtoi("-91283472332")
#coding=utf-8 """ __create_time__ = '13-10-29' __author__ = 'Madre' """
""" LeetCode Problem: 694. Number of Distinct Islands Link: https://leetcode.com/problems/number-of-distinct-islands/ Language: Python Written by: Mostofa Adib Shakib Time Complexity: O(n) Space Complexity: O(n) X => Start O => Out of bound or water U => Up L => Left R => Right D => Down """ class Solution: def computePath(self, r, c, grid, rows, columns, direction): if r < 0 or r >= rows or c < 0 or c >= columns or grid[r][c] == 0: return "0" grid[r][c] = 0 up = self.computePath(r+1, c, grid, rows, columns, "U") down = self.computePath(r-1, c, grid, rows, columns, "D") left = self.computePath(r, c-1, grid, rows, columns, "L") right = self.computePath(r, c+1, grid, rows, columns, "R") return direction + left + right + up + down def numDistinctIslands(self, grid: List[List[int]]) -> int: if len(grid) == 0: return 0 rows = len(grid) columns = len(grid[0]) visited = set() for r in range(rows): for c in range(columns): if grid[r][c] == 1: visited.add(self.computePath(r, c, grid, rows, columns, "X")) return len(visited)
#!/usr/bin/env python """Script for producing bad_ants text files.""" JDs = [ 2458098, 2458099, 2458101, 2458102, 2458103, 2458104, 2458105, 2458106, 2458107, 2458108, 2458109, 2458110, 2458111, 2458112, 2458113, 2458114, 2458115, 2458116, 2458140, ] always_flagged = [0, 2, 50, 98, 136] for JD in JDs: flagged = set(always_flagged) if JD == 2458114: flagged.add(11) if JD == 2458140: flagged.add(68) flagged.add(104) flagged.add(117) with open(str(JD) + ".txt", "w") as f: for bad_ant in sorted(flagged): f.write(str(bad_ant) + "\n")
# Leo colorizer control file for velocity mode. # This file is in the public domain. # Properties for velocity mode. properties = { "commentEnd": "*#", "commentStart": "#*", "lineComment": "##", } # Attributes dict for velocity_main ruleset. velocity_main_attributes_dict = { "default": "null", "digit_re": "", "escape": "", "highlight_digits": "true", "ignore_case": "true", "no_word_sep": "", } # Attributes dict for velocity_velocity ruleset. velocity_velocity_attributes_dict = { "default": "null", "digit_re": "", "escape": "", "highlight_digits": "true", "ignore_case": "true", "no_word_sep": "", } # Attributes dict for velocity_javascript ruleset. velocity_javascript_attributes_dict = { "default": "MARKUP", "digit_re": "", "escape": "", "highlight_digits": "true", "ignore_case": "true", "no_word_sep": "", } # Attributes dict for velocity_javascript2 ruleset. velocity_javascript2_attributes_dict = { "default": "MARKUP", "digit_re": "(0x[[:xdigit:]]+[lL]?|[[:digit:]]+(e[[:digit:]]*)?[lLdDfF]?)", "escape": "\\", "highlight_digits": "true", "ignore_case": "false", "no_word_sep": "", } # Attributes dict for velocity_back_to_html ruleset. velocity_back_to_html_attributes_dict = { "default": "MARKUP", "digit_re": "(0x[[:xdigit:]]+[lL]?|[[:digit:]]+(e[[:digit:]]*)?[lLdDfF]?)", "escape": "\\", "highlight_digits": "true", "ignore_case": "false", "no_word_sep": "", } # Attributes dict for velocity_css ruleset. velocity_css_attributes_dict = { "default": "MARKUP", "digit_re": "(0x[[:xdigit:]]+[lL]?|[[:digit:]]+(e[[:digit:]]*)?[lLdDfF]?)", "escape": "\\", "highlight_digits": "true", "ignore_case": "false", "no_word_sep": "", } # Attributes dict for velocity_css2 ruleset. velocity_css2_attributes_dict = { "default": "MARKUP", "digit_re": "[[:digit:]]+(pt|pc|in|mm|cm|em|ex|px|ms|s|%)", "escape": "\\", "highlight_digits": "true", "ignore_case": "true", "no_word_sep": "-_", } # Dictionary of attributes dictionaries for velocity mode. attributesDictDict = { "velocity_back_to_html": velocity_back_to_html_attributes_dict, "velocity_css": velocity_css_attributes_dict, "velocity_css2": velocity_css2_attributes_dict, "velocity_javascript": velocity_javascript_attributes_dict, "velocity_javascript2": velocity_javascript2_attributes_dict, "velocity_main": velocity_main_attributes_dict, "velocity_velocity": velocity_velocity_attributes_dict, } # Keywords dict for velocity_main ruleset. velocity_main_keywords_dict = {} # Keywords dict for velocity_velocity ruleset. velocity_velocity_keywords_dict = { "#else": "keyword1", "#elseif": "keyword1", "#end": "keyword1", "#foreach": "keyword1", "#if": "keyword1", "#include": "keyword1", "#macro": "keyword1", "#parse": "keyword1", "#set": "keyword1", "#stop": "keyword1", } # Keywords dict for velocity_javascript ruleset. velocity_javascript_keywords_dict = {} # Keywords dict for velocity_javascript2 ruleset. velocity_javascript2_keywords_dict = {} # Keywords dict for velocity_back_to_html ruleset. velocity_back_to_html_keywords_dict = {} # Keywords dict for velocity_css ruleset. velocity_css_keywords_dict = {} # Keywords dict for velocity_css2 ruleset. velocity_css2_keywords_dict = {} # Dictionary of keywords dictionaries for velocity mode. keywordsDictDict = { "velocity_back_to_html": velocity_back_to_html_keywords_dict, "velocity_css": velocity_css_keywords_dict, "velocity_css2": velocity_css2_keywords_dict, "velocity_javascript": velocity_javascript_keywords_dict, "velocity_javascript2": velocity_javascript2_keywords_dict, "velocity_main": velocity_main_keywords_dict, "velocity_velocity": velocity_velocity_keywords_dict, } # Rules for velocity_main ruleset. def velocity_rule0(colorer, s, i): return colorer.match_span(s, i, kind="comment1", begin="<!--", end="-->", at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="",exclude_match=False, no_escape=False, no_line_break=False, no_word_break=False) def velocity_rule1(colorer, s, i): return colorer.match_span(s, i, kind="markup", begin="<SCRIPT", end="</SCRIPT>", at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="velocity::javascript",exclude_match=False, no_escape=False, no_line_break=False, no_word_break=False) def velocity_rule2(colorer, s, i): return colorer.match_span(s, i, kind="markup", begin="<STYLE", end="</STYLE>", at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="velocity::css",exclude_match=False, no_escape=False, no_line_break=False, no_word_break=False) def velocity_rule3(colorer, s, i): return colorer.match_span(s, i, kind="keyword2", begin="<!", end=">", at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="xml::dtd-tags",exclude_match=False, no_escape=False, no_line_break=False, no_word_break=False) def velocity_rule4(colorer, s, i): return colorer.match_span(s, i, kind="markup", begin="<", end=">", at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="html::tags",exclude_match=False, no_escape=False, no_line_break=False, no_word_break=False) def velocity_rule5(colorer, s, i): return colorer.match_span(s, i, kind="literal2", begin="&", end=";", at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="",exclude_match=False, no_escape=False, no_line_break=False, no_word_break=True) # Rules dict for velocity_main ruleset. rulesDict1 = { "&": [velocity_rule5,], "<": [velocity_rule0,velocity_rule1,velocity_rule2,velocity_rule3,velocity_rule4,], } # Rules for velocity_velocity ruleset. def velocity_rule6(colorer, s, i): return colorer.match_span(s, i, kind="comment2", begin="#*", end="*#", at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="",exclude_match=False, no_escape=False, no_line_break=False, no_word_break=False) def velocity_rule7(colorer, s, i): return colorer.match_eol_span(s, i, kind="comment3", seq="##", at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="", exclude_match=False) def velocity_rule8(colorer, s, i): return colorer.match_span(s, i, kind="keyword3", begin="${", end="}", at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="",exclude_match=False, no_escape=False, no_line_break=True, no_word_break=False) def velocity_rule9(colorer, s, i): return colorer.match_mark_following(s, i, kind="keyword3", pattern="$!", at_line_start=False, at_whitespace_end=False, at_word_start=False, exclude_match=False) def velocity_rule10(colorer, s, i): return colorer.match_mark_following(s, i, kind="keyword3", pattern="$", at_line_start=False, at_whitespace_end=False, at_word_start=False, exclude_match=False) def velocity_rule11(colorer, s, i): return colorer.match_keywords(s, i) # Rules dict for velocity_velocity ruleset. rulesDict2 = { "#": [velocity_rule6,velocity_rule7,velocity_rule11,], "$": [velocity_rule8,velocity_rule9,velocity_rule10,], "0": [velocity_rule11,], "1": [velocity_rule11,], "2": [velocity_rule11,], "3": [velocity_rule11,], "4": [velocity_rule11,], "5": [velocity_rule11,], "6": [velocity_rule11,], "7": [velocity_rule11,], "8": [velocity_rule11,], "9": [velocity_rule11,], "@": [velocity_rule11,], "A": [velocity_rule11,], "B": [velocity_rule11,], "C": [velocity_rule11,], "D": [velocity_rule11,], "E": [velocity_rule11,], "F": [velocity_rule11,], "G": [velocity_rule11,], "H": [velocity_rule11,], "I": [velocity_rule11,], "J": [velocity_rule11,], "K": [velocity_rule11,], "L": [velocity_rule11,], "M": [velocity_rule11,], "N": [velocity_rule11,], "O": [velocity_rule11,], "P": [velocity_rule11,], "Q": [velocity_rule11,], "R": [velocity_rule11,], "S": [velocity_rule11,], "T": [velocity_rule11,], "U": [velocity_rule11,], "V": [velocity_rule11,], "W": [velocity_rule11,], "X": [velocity_rule11,], "Y": [velocity_rule11,], "Z": [velocity_rule11,], "a": [velocity_rule11,], "b": [velocity_rule11,], "c": [velocity_rule11,], "d": [velocity_rule11,], "e": [velocity_rule11,], "f": [velocity_rule11,], "g": [velocity_rule11,], "h": [velocity_rule11,], "i": [velocity_rule11,], "j": [velocity_rule11,], "k": [velocity_rule11,], "l": [velocity_rule11,], "m": [velocity_rule11,], "n": [velocity_rule11,], "o": [velocity_rule11,], "p": [velocity_rule11,], "q": [velocity_rule11,], "r": [velocity_rule11,], "s": [velocity_rule11,], "t": [velocity_rule11,], "u": [velocity_rule11,], "v": [velocity_rule11,], "w": [velocity_rule11,], "x": [velocity_rule11,], "y": [velocity_rule11,], "z": [velocity_rule11,], } # Rules for velocity_javascript ruleset. def velocity_rule12(colorer, s, i): return colorer.match_seq(s, i, kind="markup", seq=">", at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="velocity::javascript2") def velocity_rule13(colorer, s, i): return colorer.match_seq(s, i, kind="markup", seq="SRC=", at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="velocity::back_to_html") # Rules dict for velocity_javascript ruleset. rulesDict3 = { ">": [velocity_rule12,], "S": [velocity_rule13,], } # Rules for velocity_javascript2 ruleset. # Rules dict for velocity_javascript2 ruleset. rulesDict4 = {} # Rules for velocity_back_to_html ruleset. def velocity_rule14(colorer, s, i): return colorer.match_seq(s, i, kind="markup", seq=">", at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="velocity::main") # Rules dict for velocity_back_to_html ruleset. rulesDict5 = { ">": [velocity_rule14,], } # Rules for velocity_css ruleset. def velocity_rule15(colorer, s, i): return colorer.match_seq(s, i, kind="markup", seq=">", at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="velocity::css2") # Rules dict for velocity_css ruleset. rulesDict6 = { ">": [velocity_rule15,], } # Rules for velocity_css2 ruleset. # Rules dict for velocity_css2 ruleset. rulesDict7 = {} # x.rulesDictDict for velocity mode. rulesDictDict = { "velocity_back_to_html": rulesDict5, "velocity_css": rulesDict6, "velocity_css2": rulesDict7, "velocity_javascript": rulesDict3, "velocity_javascript2": rulesDict4, "velocity_main": rulesDict1, "velocity_velocity": rulesDict2, } # Import dict for velocity mode. importDict = { "velocity_css2": ["velocity_css2::velocity","css::main",], "velocity_javascript2": ["velocity_javascript2::velocity","javascript::main",], "velocity_main": ["velocity_main::velocity",], }
"""Constants used in Integer. """ MAX_INT = 2 ** 31 - 1 FAILED = -2147483646.0
num_waves = 4 num_eqn = 5 num_aux = 5 # Conserved quantities sigma_11 = 0 sigma_22 = 1 sigma_12 = 2 u = 3 v = 4 # Auxiliary variables density = 0 lamda = 1 mu = 2 cp = 3 cs = 4
# encoding:utf-8 class Word: def __init__(self, id, form, label): self.id = id self.org_form = form self.form = form.lower() self.label = label def __str__(self): values = [str(self.id), self.org_form, self.label] return '\t'.join(values) class Sentence: def __init__(self, words, bert_token=None, lang_id=None): self.words = list(words) self.length = len(self.words) self.key_head = -1 self.key_start = -1 self.key_end = -1 self.key_label = "" self.lang_id = lang_id if bert_token is not None: sentence_list = [word.org_form for word in self.words] self.list_bert_indice, self.list_segments_id, self.list_piece_id = bert_token.bert_ids(sentence_list) for idx in range(self.length): if words[idx].label.endswith("-*"): self.key_head = idx self.key_label = words[idx].label[2:-2] break for idx in range(self.length): cur_label = words[idx].label if cur_label.startswith("B-"+self.key_label) or cur_label.startswith("S-"+self.key_label): self.key_start = idx if cur_label.startswith("E-"+self.key_label) or cur_label.startswith("S-"+self.key_label): self.key_end = idx def label_to_entity(labels): length = len(labels) entities = set() idx = 0 while idx < length: if labels[idx] == "O": idx = idx + 1 elif labels[idx].startswith("B-"): label = labels[idx][2:] predict = False if label.endswith("-*"): label = label[0:-2] predict = True next_idx = idx + 1 end_idx = idx while next_idx < length: if labels[next_idx] == "O" or labels[next_idx].startswith("B-") \ or labels[next_idx].startswith("S-"): break next_label = labels[next_idx][2:] if next_label.endswith("-*"): next_label = next_label[0:-2] predict = True if next_label != label: break end_idx = next_idx next_idx = next_idx + 1 if end_idx == idx: new_label = "S-" + labels[idx][2:] print("Change %s to %s" % (labels[idx], new_label)) labels[idx] = new_label if not predict: entities.add("[%d,%d]%s"%(idx, end_idx, label)) idx = end_idx + 1 elif labels[idx].startswith("S-"): label = labels[idx][2:] predict = False if label.endswith("-*"): label = label[0:-2] predict = True if not predict: entities.add("[%d,%d]%s"%(idx, idx, label)) idx = idx + 1 elif labels[idx].startswith("M-"): new_label = "B-" + labels[idx][2:] print("Change %s to %s" % (labels[idx], new_label)) labels[idx] = new_label else: new_label = "S-" + labels[idx][2:] print("Change %s to %s" % (labels[idx], new_label)) labels[idx] = new_label return entities def normalize_labels(labels): length = len(labels) change = 0 normed_labels = [] for idx in range(length): normed_labels.append(labels[idx]) idx = 0 while idx < length: if labels[idx] == "O": idx = idx + 1 elif labels[idx].startswith("B-"): label = labels[idx][2:] if label.endswith("-*"): label = label[0:-2] next_idx = idx + 1 end_idx = idx while next_idx < length: if labels[next_idx] == "O" or labels[next_idx].startswith("B-") \ or labels[next_idx].startswith("S-"): break next_label = labels[next_idx][2:] if next_label.endswith("-*"): next_label = next_label[0:-2] if next_label != label: break end_idx = next_idx next_idx = next_idx + 1 if end_idx == idx: new_label = "S-" + labels[idx][2:] #print("Change %s to %s" % (labels[idx], new_label)) labels[idx] = new_label normed_labels[idx] = new_label change = change + 1 idx = end_idx + 1 elif labels[idx].startswith("S-"): idx = idx + 1 elif labels[idx].startswith("M-"): new_label = "B-" + labels[idx][2:] #print("Change %s to %s" % (labels[idx], new_label)) normed_labels[idx] = new_label labels[idx] = new_label change = change + 1 else: new_label = "S-" + labels[idx][2:] #print("Change %s to %s" % (labels[idx], new_label)) normed_labels[idx] = new_label labels[idx] = new_label change = change + 1 return normed_labels, change def getListFromStr(entity): entity_del_start = ''.join(list(entity)[1:]) # entity_del_start: '2,3]TARGET' new_entity = entity_del_start.split(']') start, end = new_entity[0].split(',') start, end = int(start), int(end) # start: 2 end: 3 label = new_entity[1] # label: 'TARGET' return [start, end, label] def evalSRLExact(gold, predict): glength, plength = gold.length, predict.length if glength != plength: raise Exception('gold length does not match predict length.') goldlabels, predictlabels = [], [] for idx in range(glength): goldlabels.append(gold.words[idx].label) predictlabels.append(predict.words[idx].label) # class set{'[2,4]TARGET', '[0,0]AGENT'} gold_entities = label_to_entity(goldlabels) # class set{'[2,3]TARGET', '[0,1]AGENT', '[2,4]ad>'} predict_entities = label_to_entity(predictlabels) gold_entity_num, predict_entity_num, correct_entity_num = len(gold_entities), len(predict_entities), 0 gold_agent_entity_num, predict_agent_entity_num, correct_agent_entity_num = 0, 0, 0 gold_target_entity_num, predict_target_entity_num, correct_target_entity_num = 0, 0, 0 for entity in gold_entities: if entity.endswith('AGENT'): gold_agent_entity_num += 1 elif entity.endswith('TARGET'): gold_target_entity_num += 1 for entity in predict_entities: if entity.endswith('AGENT'): predict_agent_entity_num += 1 elif entity.endswith('TARGET'): predict_target_entity_num += 1 for one_entity in gold_entities: if one_entity in predict_entities: correct_entity_num = correct_entity_num + 1 if one_entity.endswith('AGENT'): correct_agent_entity_num += 1 elif one_entity.endswith('TARGET'): correct_target_entity_num += 1 return gold_entity_num, predict_entity_num, correct_entity_num, \ gold_agent_entity_num, predict_agent_entity_num, correct_agent_entity_num, \ gold_target_entity_num, predict_target_entity_num, correct_target_entity_num def jiaoji(a1, a2, b1, b2): if a1 == b1 and a2 == b2: return True else: list1 = list(range(a1, a2+1)) list2 = list(range(b1, b2+1)) if len(set(list1).intersection(set(list2))) != 0: return True return False def contain_len(a1, a2, b1, b2): return len(set(list(range(a1, a2 + 1))).intersection(set(list(range(b1, b2 + 1))))) def evalSRLBinary(gold, predict): glength, plength = gold.length, predict.length if glength != plength: raise Exception('gold length does not match predict length.') goldlabels, predictlabels = [], [] for idx in range(glength): goldlabels.append(gold.words[idx].label) predictlabels.append(predict.words[idx].label) # class set{'[2,4]TARGET', '[0,0]AGENT'} gold_entities = label_to_entity(goldlabels) # class set{'[2,3]TARGET', '[0,1]AGENT', '[2,4]ad>'} predict_entities = label_to_entity(predictlabels) gold_entity_num, predict_entity_num, gold_correct_entity_num, predict_correct_entity_num = len(gold_entities), len( predict_entities), 0, 0 gold_agent_entity_num, predict_agent_entity_num, gold_correct_agent_entity_num, predict_correct_agent_entity_num = 0, 0, 0, 0 gold_target_entity_num, predict_target_entity_num, gold_correct_target_entity_num, predict_correct_target_entity_num = 0, 0, 0, 0 for entity in gold_entities: if entity.endswith('AGENT'): gold_agent_entity_num += 1 elif entity.endswith('TARGET'): gold_target_entity_num += 1 for entity in predict_entities: if entity.endswith('AGENT'): predict_agent_entity_num += 1 elif entity.endswith('TARGET'): predict_target_entity_num += 1 for gold_entity in gold_entities: for predict_entity in predict_entities: gold_start, gold_end, gold_label = getListFromStr(gold_entity) predict_start, predict_end, predict_label = getListFromStr(predict_entity) if gold_label == predict_label and jiaoji(gold_start, gold_end, predict_start, predict_end): gold_correct_entity_num += 1 if gold_label == 'AGENT': gold_correct_agent_entity_num += 1 elif gold_label == 'TARGET': gold_correct_target_entity_num += 1 break for predict_entity in predict_entities: for gold_entity in gold_entities: gold_start, gold_end, gold_label = getListFromStr(gold_entity) predict_start, predict_end, predict_label = getListFromStr(predict_entity) if gold_label == predict_label and jiaoji(gold_start, gold_end, predict_start, predict_end): predict_correct_entity_num += 1 if gold_label == 'AGENT': predict_correct_agent_entity_num += 1 elif gold_label == 'TARGET': predict_correct_target_entity_num += 1 break return gold_entity_num, predict_entity_num, gold_correct_entity_num, predict_correct_entity_num, \ gold_agent_entity_num, predict_agent_entity_num, gold_correct_agent_entity_num, predict_correct_agent_entity_num, \ gold_target_entity_num, predict_target_entity_num, gold_correct_target_entity_num, predict_correct_target_entity_num def evalSRLProportional(gold, predict): glength, plength = gold.length, predict.length if glength != plength: raise Exception('gold length does not match predict length.') goldlabels, predictlabels = [], [] for idx in range(glength): goldlabels.append(gold.words[idx].label) predictlabels.append(predict.words[idx].label) # class set{'[2,4]TARGET', '[0,0]AGENT'} gold_entities = label_to_entity(goldlabels) # class set{'[2,3]TARGET', '[0,1]AGENT', '[2,4]ad>'} predict_entities = label_to_entity(predictlabels) gold_entity_num, predict_entity_num, gold_correct_entity_num, predict_correct_entity_num = len(gold_entities), len( predict_entities), 0, 0 gold_agent_entity_num, predict_agent_entity_num, gold_correct_agent_entity_num, predict_correct_agent_entity_num = 0, 0, 0, 0 gold_target_entity_num, predict_target_entity_num, gold_correct_target_entity_num, predict_correct_target_entity_num = 0, 0, 0, 0 for entity in gold_entities: if entity.endswith('AGENT'): gold_agent_entity_num += 1 elif entity.endswith('TARGET'): gold_target_entity_num += 1 for entity in predict_entities: if entity.endswith('AGENT'): predict_agent_entity_num += 1 elif entity.endswith('TARGET'): predict_target_entity_num += 1 for gold_entity in gold_entities: for predict_entity in predict_entities: gold_start, gold_end, gold_label = getListFromStr(gold_entity) predict_start, predict_end, predict_label = getListFromStr(predict_entity) if gold_label == predict_label and jiaoji(gold_start, gold_end, predict_start, predict_end): correct_len = contain_len(gold_start, gold_end, predict_start, predict_end) gold_correct_rate = (correct_len / (gold_end - gold_start + 1)) gold_correct_entity_num += gold_correct_rate if gold_label == 'AGENT': gold_correct_agent_entity_num += gold_correct_rate elif gold_label == 'TARGET': gold_correct_target_entity_num += gold_correct_rate break for predict_entity in predict_entities: for gold_entity in gold_entities: gold_start, gold_end, gold_label = getListFromStr(gold_entity) predict_start, predict_end, predict_label = getListFromStr(predict_entity) if gold_label == predict_label and jiaoji(gold_start, gold_end, predict_start, predict_end): correct_len = contain_len(gold_start, gold_end, predict_start, predict_end) predict_correct_rate = (correct_len / (predict_end - predict_start + 1)) predict_correct_entity_num += predict_correct_rate if gold_label == 'AGENT': predict_correct_agent_entity_num += predict_correct_rate elif gold_label == 'TARGET': predict_correct_target_entity_num += predict_correct_rate break return gold_entity_num, predict_entity_num, gold_correct_entity_num, predict_correct_entity_num, \ gold_agent_entity_num, predict_agent_entity_num, gold_correct_agent_entity_num, predict_correct_agent_entity_num, \ gold_target_entity_num, predict_target_entity_num, gold_correct_target_entity_num, predict_correct_target_entity_num def readSRL(file, bert_token=None, lang_id=None): min_count = 1 total = 0 words = [] for line in file: tok = line.strip().split() if not tok or line.strip() == '' or line.strip().startswith('#'): if len(words) > min_count: total += 1 yield Sentence(words, bert_token, lang_id) words = [] elif len(tok) == 3: try: words.append(Word(int(tok[0]), tok[1], tok[2])) except Exception: pass else: pass if len(words) > min_count: total += 1 yield Sentence(words, bert_token, lang_id) print("Total num: ", total) def writeSRL(filename, sentences): with open(filename, 'w') as file: for sentence in sentences: for entry in sentence.words: file.write(str(entry) + '\n') file.write('\n') def printSRL(output, sentence): for entry in sentence.words: output.write(str(entry) + '\n') output.write('\n')
BATCH_SIZE = 100 # Constants describing the training process. MOVING_AVERAGE_DECAY = 0.9999 # The decay to use for the moving average. NUM_EPOCHS_PER_DECAY = 50 # Epochs after which learning rate decays. LEARNING_RATE_DECAY_FACTOR = 0.1 # Learning rate decay factor. INITIAL_LEARNING_RATE = 0.001 # Initial learning rate. EVAL_INTERVAL_SECS = 60 """How often to run the eval.""" NUM_EXAMPLES_PER_EPOCH_FOR_EVAL = 800 EVAL_NUM_EXAMPLES = 800 """Number of examples to run for eval.""" EVAL_RUN_ONCE = False """Whether to run eval only once.""" NUM_EXAMPLES_PER_EPOCH_FOR_TRAIN = 5000 IMAGE_HEIGHT = 160 IMAGE_WIDTH = 60 IMAGE_CHANNELS = 3 NUM_CLASSES = 2 LABEL_BYTES = 1 DATA_BATCH_COUNT = 10 LOG_DEVICE_PLACEMENT = False """Whether to log device placement.""" LOG_FREQUENCY = 10 """How often to log results to the console.""" TRAIN_ACCURACY_FREQUENCY = 20 USE_FP16 = False NUM_EPOCHS = 70 MAX_STEPS = NUM_EXAMPLES_PER_EPOCH_FOR_TRAIN/BATCH_SIZE * NUM_EPOCHS """Number of batches to run."""
def rsum(any_list): '''(list of int) -> int REQ: Length of the list must be greater than 0 This function will add up all the integers in the given list of integers >>>rsum([9,1000,-1000,57,78,0]) 144 >>>rsum([1]) 1 ''' # Base case for one element if len(any_list) == 1: # Return that integer return any_list[0] # Otherwise keep breaking the list and adding the previous number else: return any_list[0] + rsum(any_list[1:]) def rmax(any_list): '''(list of int) -> int REQ: Length of the list must be greater than 0 This function will find the greatest integer in the given list >>>rmax([9,1000,-1000,57,78,0]) 1000 >>>rmax([180]) 180 ''' # Base case for one element if len(any_list) == 1: # That is the maximum integer return any_list[0] # Otherwise keep breaking the list using same function else: result = rmax(any_list[1:]) # If the result is greater then return it if result > any_list[0]: return result # Else return the previous integer else: return any_list[0] def second_smallest(L): '''(list of int) -> int REQ: Length of the list must be greater than 1 This function will find the second smallest integer in the given list >>>second_smallest([[9,1000],[0],[],[[1,2,3],-1000]]) 0 >>>second_smallest([[1],[[1,1],[1]]]) 1 >>>second_smallest([[],[[2],9,8,8]]) 8 ''' # Get the tuple contaning smallest and second smallest integers result = helper_second_min(L) # Return the second smallest integer return result[1] def sum_max_min(L): '''(list of int) -> int REQ: Length of the list must be greater than 0 This function will add the lowest and highest integers and output the sum in the given list >>>sum_max_min([[9,1000],[0],[],[[1,2,3],-1000]]) 0 >>>sum_max_min([[1],[[1,1],[1]]]) 2 >>>sum_max_min([[[[[10]]]]]) 20 ''' # Get the tuple containing the smallest and the largest integers result = helper_max_min(L) # Return the sum of those integers return result[0] + result[1] # Helper Functions def helper_second_min(L): ''' (list) -> tuple REQ: Length of the list must be greater than 1 This function will take any given list and it will return the smallest and the second smallest integers in the list ''' # Base Case: If there are only two integers to compare if len(L) == 2: # Then the larger integer is second smallest and the other is the # smallest if L[0] < L[1]: smallest = L[0] ssmallest = L[1] return (smallest, ssmallest) else: smallest = L[1] ssmallest = L[0] return (smallest, ssmallest) # Else recursivley call the function again until it has len(L) == 2 else: result = helper_second_min(L[1:]) # If the smallest number in tuple is greater than the next integer if result[0] > L[0]: # If the second smallest integer in the tuple is greater if result[1] > L[0]: # Then update the smallest integer (smallest, ssmallest) = (L[0], result[0]) # Otherwise update the second smallest integer else: (smallest, ssmallest) = (L[0], result[1]) # If the second smallest number in tuple is greater than the next # integer elif result[1] > L[0]: # If the smallest integer is greater than the next integer if result[0] > L[0]: # Then update the second smallest integer (smallest, ssmallest) = (result[1], L[0]) # Otherwise update the smallest integer else: (smallest, ssmallest) = (result[0], L[0]) # If the integer found is greater than both our integers in the tuple # then move on to the next integer in the list and do not update else: (smallest, ssmallest) = (result[0], result[1]) # Return the tuple of the smallest and the second smallest integers return (smallest, ssmallest) def helper_max_min(L): '''(list) -> tuple REQ: Length of the list must be greater than 0 This function will take in any given list and return the tuple of the maximum and the minimum integers ''' # Base Case: If there is only one integer in the list if len(L) == 1: # Then the integer is the max and the min of the list maximum = minimum = L[0] return (maximum, minimum) # Else recursively call the function again else: result = helper_max_min(L[1:]) # If the maximum integer is greater than the next integer than don't # update if result[0] > L[0]: (maximum, minimum) = (result[0], result[1]) # Otherwise update the maximum integer else: (maximum, minimum) = (L[0], result[1]) # If the minimum integer is lower then the next integer than don't # update if result[1] < L[0]: (maximum, minimum) = (maximum, result[1]) # Otherwise don't update the minimum integer else: (maximum, minimum) = (maximum, L[0]) # Return the tuple of the maximum and the minimum integers return (maximum, minimum) # HOW TO SIMPLIFY ANY TYPE OF LIST OF INTEGERS def flatten_list(L): ''' (list) -> list This function will take a nested list and flatten it out into a single list >>>flatten_list([[1,2,3],[7],[[9,87,-1]]]) [9, 87, -1, 1, 2, 3, 7] >>>flatten_list([[[[[]]]]]) [] >>>flatten_list([100,99,98]) [100, 99, 98] ''' # Call the helper function to check whether the list is nested is not single_list = multiple_lists(L) # If its not nested then return the original list if(single_list): return L # Otherwise we have a nested list else: # If list of list is found then recursively call the same function on # the rest of the list and removing the first element and adding it in # the base level at the beginning if(isinstance(L[0], list) and L[0] != []): return flatten_list(L[0] + L[1:]) # If list of integers is found then recursively call the small function # on the rest of the list and removing the first element and adding # it in the end at the base level elif(isinstance(L[0], int) and len(L) > 1): return flatten_list(L[1:] + [L[0]]) # If list of empty list is found then just recurse on the rest of the # list elif(L[0] == [] and len(L) > 1): return flatten_list(L[1:]) # If an empty list is found then we don't require that so delete it elif(L[0] == []): del L[0] return flatten_list(L) def multiple_lists(L): '''(list) -> bool This function will check whether the list is nested or not. It will return True if and only if the list is not nested >>>multiple_lists([1,2,3,[4]]) False >>>multiple_lists([1,2,3]) True ''' # Loop through each element in the given list for elements in L: # Check to see if the type is a list and return False if nested list # is found if(isinstance(elements, list)): return False # Otherwise return True return True
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # This file is part of Androwarn. # # Copyright (C) 2012, 2019, Thomas Debize <tdebize at mail.com> # All rights reserved. # # Androwarn is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Androwarn is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with Androwarn. If not, see <http://www.gnu.org/licenses/>. # This file maps the integer values with the constant names for several android classes MediaRecorder_AudioSource = { 0x0: 'DEFAULT', 0x1: 'MIC', 0x2: 'VOICE_UPLINK', 0x3: 'VOICE_DOWNLINK', 0x4: 'VOICE_CALL', 0x5: 'CAMCORDER', 0x6: 'VOICE_RECOGNITION', 0x7: 'VOICE_COMMUNICATION', 0x8: 'REMOTE_SUBMIX', 0x9: 'UNPROCESSED' } MediaRecorder_VideoSource = { 0x0: 'DEFAULT', 0x1: 'CAMERA', 0x2: 'SURFACE' } PackageManager_PackageInfo = { 0x1: 'GET_ACTIVITIES', 0x4000: 'GET_CONFIGURATIONS', 0x200: 'MATCH_DISABLED_COMPONENTS', 0x100: 'GET_GIDS', 0x10: 'GET_INSTRUMENTATION', 0x20: 'GET_INTENT_FILTERS', 0x80: 'GET_META_DATA', 0x1000: 'GET_PERMISSIONS', 0x8: 'GET_PROVIDERS', 0x2: 'GET_RECEIVERS', 0x40: 'GET_RESOLVED_FILTER', 0x4: 'GET_SERVICES', 0x400: 'GET_SHARED_LIBRARY_FILES', 0x40: 'GET_SIGNATURES', 0x08000000: 'GET_SIGNING_CERTIFICATES', 0x2000: 'MATCH_UNINSTALLED_PACKAGES', 0x800: 'GET_URI_PERMISSION_PATTERNS', 0x00008000: 'MATCH_DISABLED_UNTIL_USED_COMPONENTS', 0x00100000: 'MATCH_SYSTEM_ONLY' }
# network size ict_head_size = None # checkpointing ict_load = None bert_load = None # data titles_data_path = None query_in_block_prob = 0.1 use_one_sent_docs = False # training report_topk_accuracies = [] # faiss index faiss_use_gpu = False block_data_path = None # indexer indexer_batch_size = 128 indexer_log_interval = 1000
# # PySNMP MIB module TFTIF-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/TFTIF-MIB # Produced by pysmi-0.3.4 at Wed May 1 15:16:16 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # ObjectIdentifier, OctetString, Integer = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "OctetString", "Integer") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ConstraintsIntersection, ConstraintsUnion, ValueSizeConstraint, SingleValueConstraint, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "ConstraintsUnion", "ValueSizeConstraint", "SingleValueConstraint", "ValueRangeConstraint") micom_oscar, = mibBuilder.importSymbols("MICOM-OSCAR-MIB", "micom-oscar") mcmSysAsciiTimeOfDay, = mibBuilder.importSymbols("MICOM-SYS-MIB", "mcmSysAsciiTimeOfDay") ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup") Counter32, Counter64, ModuleIdentity, iso, ObjectIdentity, NotificationType, Unsigned32, Bits, MibScalar, MibTable, MibTableRow, MibTableColumn, TimeTicks, IpAddress, Integer32, Gauge32, NotificationType, MibIdentifier = mibBuilder.importSymbols("SNMPv2-SMI", "Counter32", "Counter64", "ModuleIdentity", "iso", "ObjectIdentity", "NotificationType", "Unsigned32", "Bits", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "TimeTicks", "IpAddress", "Integer32", "Gauge32", "NotificationType", "MibIdentifier") DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention") class MemAddress(OctetString): subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(4, 4) fixedLength = 4 mcmTFTP = MibIdentifier((1, 3, 6, 1, 4, 1, 335, 1, 4, 3)) mcmTFTPParamGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 335, 1, 4, 3, 1)) mcmTFTPServerIpAddr = MibScalar((1, 3, 6, 1, 4, 1, 335, 1, 4, 3, 1, 1), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: mcmTFTPServerIpAddr.setStatus('mandatory') if mibBuilder.loadTexts: mcmTFTPServerIpAddr.setDescription('NAME = ; DESC = The IP Address of the TFTP Server.; HELP = ; CAPABILITIES = NET_CFG, VPN_NONE;') mcmTFTPFileName = MibScalar((1, 3, 6, 1, 4, 1, 335, 1, 4, 3, 1, 2), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: mcmTFTPFileName.setStatus('mandatory') if mibBuilder.loadTexts: mcmTFTPFileName.setDescription('NAME = ; DESC = The Filename with path (ASCII) to be downloaded; HELP = ; CAPABILITIES = NET_CFG, VPN_NONE;') mcmTFTPTimeOut = MibScalar((1, 3, 6, 1, 4, 1, 335, 1, 4, 3, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 900))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mcmTFTPTimeOut.setStatus('mandatory') if mibBuilder.loadTexts: mcmTFTPTimeOut.setDescription('NAME = ; DESC = The TFTP timeout period in seconds.; HELP = Time is doubled for each retransmission.; CAPABILITIES = NET_CFG, VPN_NONE;') mcmTFTPRetransmissions = MibScalar((1, 3, 6, 1, 4, 1, 335, 1, 4, 3, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 100))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mcmTFTPRetransmissions.setStatus('mandatory') if mibBuilder.loadTexts: mcmTFTPRetransmissions.setDescription('NAME = ; DESC = The number of times the TFTP request \\ will be repeated for un-responsive \\ TFTP servers.; HELP = ; CAPABILITIES = NET_CFG, VPN_NONE;') mcmTFTPDownload = MibScalar((1, 3, 6, 1, 4, 1, 335, 1, 4, 3, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("upldDefault", 1), ("upldSpecific", 2), ("dnldDefault", 3), ("dnldSpecific", 4), ("disabled", 5)))).setMaxAccess("writeonly") if mibBuilder.loadTexts: mcmTFTPDownload.setStatus('deprecated') if mibBuilder.loadTexts: mcmTFTPDownload.setDescription('NAME = ; DESC = This object when enabled results in \\ the unit to attempt code download.; HELP = ; CAPABILITIES = NET_CFG, VPN_NONE;') mcmTFTPStart = MibScalar((1, 3, 6, 1, 4, 1, 335, 1, 4, 3, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("upldDefault", 1), ("upldSpecific", 2), ("dnldDefault", 3), ("dnldSpecific", 4), ("disabled", 5)))).setMaxAccess("writeonly") if mibBuilder.loadTexts: mcmTFTPStart.setStatus('mandatory') if mibBuilder.loadTexts: mcmTFTPStart.setDescription('NAME = ; DESC = initiates TFTP upload or download process\\ based on previously provisioned values \\ (default) or values passed at request \\ time(specific) ; HELP = ; CAPABILITIES = NET_CFG, VPN_NONE;') mcmTFTPPortNumber = MibScalar((1, 3, 6, 1, 4, 1, 335, 1, 4, 3, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mcmTFTPPortNumber.setStatus('mandatory') if mibBuilder.loadTexts: mcmTFTPPortNumber.setDescription('NAME = ; DESC = This object is used to specify the \\ port <socket> number sent to the TFTP\\ connection. ; HELP = ; CAPABILITIES = NET_CFG, VPN_NONE;') mcmTFTPConfigUploadBank = MibScalar((1, 3, 6, 1, 4, 1, 335, 1, 4, 3, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("bank3", 1), ("bank4", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mcmTFTPConfigUploadBank.setStatus('mandatory') if mibBuilder.loadTexts: mcmTFTPConfigUploadBank.setDescription('NAME = ; DESC = The configuration bank number which\\ will be uploaded to the TFTP host. ; HELP = ; CAPABILITIES = NET_CFG, VPN_NONE;') nvmTFTPParamGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 335, 1, 4, 3, 2)) nvmTFTPServerIpAddr = MibScalar((1, 3, 6, 1, 4, 1, 335, 1, 4, 3, 2, 1), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: nvmTFTPServerIpAddr.setStatus('mandatory') if mibBuilder.loadTexts: nvmTFTPServerIpAddr.setDescription('NAME = ; DESC = The IP Address of the TFTP Server.; HELP = ; CAPABILITIES = NET_CFG, VPN_NONE;') nvmTFTPFileName = MibScalar((1, 3, 6, 1, 4, 1, 335, 1, 4, 3, 2, 2), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: nvmTFTPFileName.setStatus('mandatory') if mibBuilder.loadTexts: nvmTFTPFileName.setDescription('NAME = ; DESC = The Filename with path (ASCII) to be \\ downloaded or to upload; HELP = ; CAPABILITIES = NET_CFG, VPN_NONE;') nvmTFTPTimeOut = MibScalar((1, 3, 6, 1, 4, 1, 335, 1, 4, 3, 2, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nvmTFTPTimeOut.setStatus('mandatory') if mibBuilder.loadTexts: nvmTFTPTimeOut.setDescription('NAME = ; DESC = The TFTP timeout period in seconds.; HELP = Time is doubled for each retransmission; CAPABILITIES = NET_CFG, VPN_NONE;') nvmTFTPRetransmissions = MibScalar((1, 3, 6, 1, 4, 1, 335, 1, 4, 3, 2, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nvmTFTPRetransmissions.setStatus('mandatory') if mibBuilder.loadTexts: nvmTFTPRetransmissions.setDescription('NAME = ; DESC = The number of times the TFTP request \\ will be repeated for un-responsive \\ TFTP servers.; HELP = ; CAPABILITIES = NET_CFG, VPN_NONE;') nvmTFTPPortNumber = MibScalar((1, 3, 6, 1, 4, 1, 335, 1, 4, 3, 2, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: nvmTFTPPortNumber.setStatus('mandatory') if mibBuilder.loadTexts: nvmTFTPPortNumber.setDescription('NAME = ; DESC = This object is used to specify the \\ port <socket> number sent to the TFTP\\ connection. ; HELP = ; CAPABILITIES = NET_CFG, VPN_NONE;') nvmTFTPConfigUploadBank = MibScalar((1, 3, 6, 1, 4, 1, 335, 1, 4, 3, 2, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("bank3", 1), ("bank4", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: nvmTFTPConfigUploadBank.setStatus('mandatory') if mibBuilder.loadTexts: nvmTFTPConfigUploadBank.setDescription('NAME = ; DESC = The configuration bank number which\\ will be uploaded to the TFTP host. ; HELP = ; CAPABILITIES = NET_CFG, VPN_NONE;') mcmTFTPStatusGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 335, 1, 4, 3, 3)) mcmTFTPCurrentState = MibScalar((1, 3, 6, 1, 4, 1, 335, 1, 4, 3, 3, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("idle", 1), ("retrieving-file", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmTFTPCurrentState.setStatus('mandatory') if mibBuilder.loadTexts: mcmTFTPCurrentState.setDescription('NAME = ; DESC = This object shows the current status \\ of TFTP interface.; HELP = ; CAPABILITIES = NET_CFG, VPN_NONE;') mcmTFTPErrorStatusGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 335, 1, 4, 3, 4)) mcmTFTPLastErrorStatus = MibScalar((1, 3, 6, 1, 4, 1, 335, 1, 4, 3, 4, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 4, 5, 6, 7, 8, 11, 13, 14, 15, 16, 17, 18))).clone(namedValues=NamedValues(("idle", 1), ("download-success", 2), ("out-of-memory", 4), ("flash-error", 5), ("download-failed", 6), ("upload-failed", 7), ("upload-success", 8), ("chksum-error", 11), ("transferring-file", 13), ("protocol-error", 14), ("server-error", 15), ("timeout", 16), ("connection-error", 17), ("bad-file", 18)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmTFTPLastErrorStatus.setStatus('mandatory') if mibBuilder.loadTexts: mcmTFTPLastErrorStatus.setDescription('NAME = ; DESC = This object shows the error status of \\ last TFTP operation.; HELP = Error status values: \\ value meaning \\ --------------------------------------------------\\ idle No download has been done \\ download-success A download completed without error\\ out-of-memory Not enough free memory \\ flash-error Could not write to flash memory \\ download-failed Download failed for an unknown reason \\ chksum-error The file to download has a checksum error \\ retrieving-file The file to download is being retrieved \\ protocol-error TFTP had an error talking to server \\ server-error The TFTP server sent error message, Could be bad file name \\ timeout Could be bad ip address or network errors \\ connection-error Setup of connection failed \\ bad-file The file to be download was rejected; CAPABILITIES = NET_CFG, VPN_NONE;') mcmTFTPLastServerIpAddr = MibScalar((1, 3, 6, 1, 4, 1, 335, 1, 4, 3, 4, 2), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmTFTPLastServerIpAddr.setStatus('mandatory') if mibBuilder.loadTexts: mcmTFTPLastServerIpAddr.setDescription('NAME = ; DESC = The IP Address of the last TFTP Server.; HELP = ; CAPABILITIES = NET_CFG, VPN_NONE;') mcmTFTPLastFileName = MibScalar((1, 3, 6, 1, 4, 1, 335, 1, 4, 3, 4, 3), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmTFTPLastFileName.setStatus('mandatory') if mibBuilder.loadTexts: mcmTFTPLastFileName.setDescription('NAME = ; DESC = The Filename path (ASCII) of the previously downloaded file.; HELP = ; CAPABILITIES = NET_CFG, VPN_NONE;') mcmTFTPTransferBank = MibScalar((1, 3, 6, 1, 4, 1, 335, 1, 4, 3, 4, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9))).clone(namedValues=NamedValues(("none", 1), ("toboot", 2), ("toBank1", 3), ("toBank2", 4), ("toBank3", 5), ("toBank4", 6), ("fromBank3", 7), ("fromBank4", 8), ("fromDebug", 9)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmTFTPTransferBank.setStatus('mandatory') if mibBuilder.loadTexts: mcmTFTPTransferBank.setDescription('NAME = ; DESC = Specifies which flash bank is currently\\ being uploaded/dwonloaded via the tftp \\ application process ; HELP = ; CAPABILITIES = NET_CFG, VPN_NONE;') mcmTFTPLastPortNumber = MibScalar((1, 3, 6, 1, 4, 1, 335, 1, 4, 3, 4, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcmTFTPLastPortNumber.setStatus('mandatory') if mibBuilder.loadTexts: mcmTFTPLastPortNumber.setDescription('NAME = ; DESC = This object is used to specify the \\ port <socket> number sent to the TFTP\\ connection. ; HELP = ; CAPABILITIES = NET_CFG, VPN_NONE;') mcmTFTPDownloadFail = NotificationType((1, 3, 6, 1, 4, 1, 335, 1, 4, 3) + (0,1)).setObjects(("MICOM-SYS-MIB", "mcmSysAsciiTimeOfDay"), ("TFTIF-MIB", "mcmTFTPServerIpAddr"), ("TFTIF-MIB", "mcmTFTPFileName")) if mibBuilder.loadTexts: mcmTFTPDownloadFail.setDescription('NAME = ; DESC = A TFTP Code download has failed between the \\ PP4400 and the Server.; HELP = Please check Network cables, Server being alive, and retry \\ again. If problem persists, contact Sys Admin., or Field \\ Personnel.;') mcmTFTPUploadFail = NotificationType((1, 3, 6, 1, 4, 1, 335, 1, 4, 3) + (0,2)).setObjects(("MICOM-SYS-MIB", "mcmSysAsciiTimeOfDay"), ("TFTIF-MIB", "mcmTFTPServerIpAddr"), ("TFTIF-MIB", "mcmTFTPFileName")) if mibBuilder.loadTexts: mcmTFTPUploadFail.setDescription('NAME = ; DESC = TFTP file upload to server has failed.; HELP = See error status for type of transfer failure.;') mcmTFTPDownloadSuccess = NotificationType((1, 3, 6, 1, 4, 1, 335, 1, 4, 3) + (0,3)).setObjects(("MICOM-SYS-MIB", "mcmSysAsciiTimeOfDay"), ("TFTIF-MIB", "mcmTFTPServerIpAddr"), ("TFTIF-MIB", "mcmTFTPFileName")) if mibBuilder.loadTexts: mcmTFTPDownloadSuccess.setDescription('NAME = ; DESC = A TFTP Code download has succeeded between the \\ PP4400 and the Server.; HELP = TFTP Code download was successful. \\ Normal Status Indicator.;') mcmTFTPUploadSuccess = NotificationType((1, 3, 6, 1, 4, 1, 335, 1, 4, 3) + (0,4)).setObjects(("MICOM-SYS-MIB", "mcmSysAsciiTimeOfDay"), ("TFTIF-MIB", "mcmTFTPServerIpAddr"), ("TFTIF-MIB", "mcmTFTPFileName")) if mibBuilder.loadTexts: mcmTFTPUploadSuccess.setDescription('NAME = ; DESC = A TFTP file upload has succeeded between the \\ 4400 and the Server.; HELP = TFTP file upload was successful. \\ Normal Status Indicator.;') mibBuilder.exportSymbols("TFTIF-MIB", mcmTFTPCurrentState=mcmTFTPCurrentState, mcmTFTPLastServerIpAddr=mcmTFTPLastServerIpAddr, mcmTFTPTransferBank=mcmTFTPTransferBank, nvmTFTPPortNumber=nvmTFTPPortNumber, mcmTFTPRetransmissions=mcmTFTPRetransmissions, mcmTFTPLastErrorStatus=mcmTFTPLastErrorStatus, mcmTFTPParamGroup=mcmTFTPParamGroup, mcmTFTPServerIpAddr=mcmTFTPServerIpAddr, mcmTFTPUploadSuccess=mcmTFTPUploadSuccess, nvmTFTPFileName=nvmTFTPFileName, MemAddress=MemAddress, nvmTFTPServerIpAddr=nvmTFTPServerIpAddr, nvmTFTPParamGroup=nvmTFTPParamGroup, mcmTFTPConfigUploadBank=mcmTFTPConfigUploadBank, mcmTFTPFileName=mcmTFTPFileName, mcmTFTPStart=mcmTFTPStart, mcmTFTPTimeOut=mcmTFTPTimeOut, mcmTFTPErrorStatusGroup=mcmTFTPErrorStatusGroup, mcmTFTPUploadFail=mcmTFTPUploadFail, mcmTFTPPortNumber=mcmTFTPPortNumber, mcmTFTP=mcmTFTP, mcmTFTPDownloadFail=mcmTFTPDownloadFail, nvmTFTPConfigUploadBank=nvmTFTPConfigUploadBank, mcmTFTPLastPortNumber=mcmTFTPLastPortNumber, nvmTFTPRetransmissions=nvmTFTPRetransmissions, mcmTFTPStatusGroup=mcmTFTPStatusGroup, mcmTFTPDownload=mcmTFTPDownload, mcmTFTPDownloadSuccess=mcmTFTPDownloadSuccess, mcmTFTPLastFileName=mcmTFTPLastFileName, nvmTFTPTimeOut=nvmTFTPTimeOut)
# ------------------------------- # UFSC - CTC - INE - INE5663 # Exercício da Matriz de Inteiros # ------------------------------- # Classe que representa uma matriz de números inteiros. # class MatrizDeInteiros: def __init__(self, dimensoes_ou_numeros): '''Cria uma matriz de números inteiros. Há duas formas de criar: - passando as dimensões da matriz na forma de uma tupla: (número de linhas , número de colunas) - passando os números da matriz na forma de uma lista contendo listas de números ''' if type(dimensoes_ou_numeros) is tuple: (num_linhas, num_colunas) = dimensoes_ou_numeros self._numeros = self._zeros(num_linhas, num_colunas) else: self._numeros = dimensoes_ou_numeros def _zeros(self, num_linhas, num_colunas): '''Gera uma lista de listas contendo zeros. ''' return [ [0] * num_colunas for _ in range(num_linhas)] def armazene(self, linha, coluna, numero): '''Armazena um número na matriz em uma determinada posição (linha e coluna). Atenção: a primeira linha deve ser representada por 1. O mesmo vale para a primeira coluna. ''' pass def obtenha(self, linha, coluna): '''Retorna o número que está em uma determinada posição (linha e coluna). Atenção: a primeira linha deve ser representada por 1. O mesmo vale para a primeira coluna. ''' return 8 def num_linhas(self): '''Retorna o número de linhas da matriz. ''' return 6 def num_colunas(self): '''Retorna o número de colunas da matriz. ''' return 3 def linha(self, linha): '''Retorna uma nova lista contendo os números que estão em uma linha. Atenção: a primeira linha deve ser representada por 1. ''' return [3,4,5,6] def coluna(self, coluna): '''Retorna uma nova lista contendo os números que estão em uma coluna. Atenção: a primeira coluna deve ser representada por 1. ''' return [9,8,7] def soma_de_linha(self, linha): '''Retorna a soma dos números que estão em uma linha da matriz. Atenção: a primeira linha deve ser representada por 1. ''' return 77 def soma_de_coluna(self, coluna): '''Retorna a soma dos números que estão em uma coluna da matriz. Atenção: a primeira coluna deve ser representada por 1. ''' return 56 def somas_das_linhas(self): '''Retorna uma lista contendo as somas de cada uma das linhas da matriz. ''' return [ 23, 45, 77 ] def soma_dos_numeros(self): '''Retorna a soma de todos os números da matriz. ''' return 99 def multiplique_por_fator(self, fator): '''Multiplica cada número da matriz por um outro número (fator). ''' pass def copia(self): '''Retorna uma cópia da matriz. ''' return MatrizDeInteiros([[1,2,3], [4,5,6]]) def __add__(self, outra): '''Faz a soma da matriz self com outra matriz. Retorna a matriz resultante da soma ou None quando não for possível somar. ''' return None def __mul__(self, outra): '''Faz a multiplicação da matriz self com outra matriz. Retorna a matriz resultante da multiplicação ou None quando não for possível multiplicar. ''' return None
"""chfn help text""" CHSH = dict( text="""chsh changes your "shell" on Redbrick. ** WARNING - Do not use this command if you are unsure ** of what you are doing! :-) A "Shell" is the style of command line environment on RedBrick. It is essentially, the 'prompt' and set of commands that you get when you log in. Changing this means that your screen prompt may look different, & some commands may be different. Here are some possible shells: /usr/local/shells/bash /usr/local/shells/tcsh /usr/local/shells/ksh /usr/local/shells/zsh However Redbrick only fully supports zsh or bash.""" )
def partition(lista: list[int], low: int, high: int) -> int: i = low pivot = lista[high] for j in range(low, high): if lista[j] <= pivot: # swap lista[i], lista[j] = lista[j], lista[i] i += 1 lista[i], lista[high] = lista[high], lista[i] return i def find_k(lista: list[int], low: int, high: int, k: int) -> int: if low == high: return lista[low] else: p_index = partition(lista, low, high) p_value = lista[p_index] if k == p_index: return p_value elif k > p_index: return find_k(lista, p_index + 1, high, k) else: return find_k(lista, low, p_index - 1, k) N, i = [int(x) for x in input().split()] lista = [] for j in range(N): lista.append(int(input())) print(abs(find_k(lista, 0, len(lista) - 1, N - i) - find_k(lista, 0, len(lista) - 1, i - 1)))
DATA_FOLDER = './materialist/data' TEST_FOLDER = './materialist/data/test' TRAIN_FOLDER = './materialist/data/train' VALIDATION_FOLDER = './materialist/data/validation' TEST_FILE = './materialist/data/test.json' TRAIN_FILE = './materialist/data/train.json' VALIDATION_FILE = './materialist/data/validation.json' TEST_PICKLE = './materialist/data/test.pickle' TRAIN_PICKLE = './materialist/data/train.pickle' VALIDATION_PICKLE = './materialist/data/validation.pickle' TRAIN_LABEL_PICKLE = './materialist/data/train_label.pickle' VALIDATION_LABEL_PICKLE = './materialist/data/validation_label.pickle' RESULTS_FOLDER = './materialist/results/test/' FINAL_RESULT = './materialist/results/final.csv'
print(f'This is the python code file bar.py and my name currently is:{__name__}') if __name__ == 'bar': print(f'I was imported as a module.') print(f'bar.py __file__ variable:{__file__}') print('If the slashes in the file path lean to the right then I am __main__')
class View: @staticmethod def show_message(message): print(message) @staticmethod def get_input(): return input()
class Test: def ptr(self): print(self) print(self.__class__) class Test2: def ptr(baidu): print(baidu) print(baidu.__class__) class people: name = '' age = 0 __weight = 0 def __init__(self, n, a, w): self.name = n self.age = a self.__weight = w def speak(self): print('%s said: I %d ages' % (self.name, self.age)) t = Test() t.ptr() t2 = Test2() t2.ptr() p = people('baidu', 10, 30) p.speak()
class LambdaContext(object): def __init__( self, request_id="request_id", function_name="my-function", function_version="v1.0", ): self.aws_request_id = request_id self.function_name = function_name self.function_version = function_version def get_remaining_time_in_millis(self): return None
for i in range(int(input())): n,m,x,y = [int(j) for j in input().split()] if((n-1)%x==0 and (m-1)%y==0): print('Chefirnemo') elif(n-2>=0 and m-2>=0): if((n-2)%x==0 and (m-2)%y==0): print('Chefirnemo') else: print('Pofik') else: print('Pofik')
################################################### # header_common.py # This file contains common declarations. # DO NOT EDIT THIS FILE! ################################################### server_event_preset_message = 0 server_event_play_sound = 1 server_event_scene_prop_play_sound = 2 server_event_play_sound_at_position = 3 server_event_agent_equip_armor = 4 server_event_player_set_slot = 5 server_event_scene_prop_set_slot = 6 server_event_faction_set_slot = 7 server_event_troop_set_slot = 8 server_event_agent_set_slot = 9 server_event_show_inventory = 10 server_event_chat_message_recieved = 11 server_event_local_chat = 12 server_event_local_chat_shout = 13 server_event_faction_set_name = 14 server_event_return_game_rules = 15 server_event_return_server_name = 16 server_event_return_password = 17 server_event_set_player_score_kill_death = 18 server_event_show_poll = 19 server_event_set_overflow_gold = 20 server_event_faction_chat = 21 server_event_faction_chat_announce = 22 server_event_admin_chat = 23 server_event_admin_chat_announce = 24 server_event_admin_set_permissions = 25 server_event_set_attached_scene_prop = 26 server_event_local_animation = 27 server_event_update_scene_prop_hit_points = 28 #GGG:new server server_event_agent_stop_sound = 29 server_event_agent_play_sound = 30 ##Arthur begins server_event_player_exit_return = 31 server_event_player_set_cam = 32 # Add new events here: above if sent from the server, below if from clients. #GGG:new client ##Arthur begins client_event_player_request_exit = 92 ##Arthur ends client_event_admin_faction_action = 93 client_event_player_set_slot = 94 # client_event_request_animation = 95 agent_shield_bash = 0 #GGG:shield bash agent_loot_weapon = 1 #GGG:loot weapon client_event_reveal_money_pouch = 96 client_event_agent_loot_armor = 97 client_event_toggle_drop_armor = 98 client_event_admin_equip_item = 99 client_event_poll_vote = 100 client_event_request_poll = 101 client_event_request_spawn_point = 102 client_event_request_game_rules = 103 client_event_admin_set_server_name = 104 client_event_admin_set_password = 105 client_event_admin_set_welcome_message = 106 client_event_admin_set_game_rule = 107 client_event_admin_action = 108 client_event_faction_admin_action = 109 client_event_chat_message_begin = 110 client_event_chat_message_end = 120 client_event_chat_message_type = 120 client_event_transfer_gold = 121 client_event_request_stock_count = 122 client_event_drop_money_bag = 123 client_event_change_faction_banner = 124 client_event_transfer_inventory = 125 client_event_control_scene_prop = 126 client_event_attach_scene_prop = 127 # Network events are limited to numbers between 0 and 127 by the game engine. preset_message_default = 0x0 preset_message_item = 0x2 # converts value 1 from item id into name string preset_message_agent = 0x3 # converts value 1 from agent id into name string preset_message_player = 0x4 # converts value 1 from player id into username string preset_message_faction = 0x5 # converts value 1 from faction id into name string preset_message_faction_castle = 0x6 # converts value 1 from castle id into name string preset_message_params_mask = 0xF preset_message_white = 0x00 preset_message_red = 0x10 preset_message_green = 0x20 preset_message_blue = 0x30 preset_message_yellow = 0x40 preset_message_color_mask = 0xF0 preset_message_small = 0x000 preset_message_big = 0x100 preset_message_read_object = 0x200 # displays the presentation for reading a book preset_message_chat_only = 0x300 # only displays in the chat log preset_message_type_mask = 0xF00 preset_message_log = 0x1000 # add message to the chat log preset_message_fail_sound = 0x2000 # play a failure sound preset_message_error = preset_message_red|preset_message_fail_sound preset_message_info = preset_message_yellow preset_message_chat_log = preset_message_chat_only|preset_message_log # Module system commands command_get_bot_count = 1 command_set_bot_count = 2 command_get_round_max_seconds = 3 command_set_round_max_seconds = 4 command_get_respawn_period = 5 command_set_respawn_period = 6 command_get_num_bots_voteable = 7 command_set_num_bots_voteable = 8 command_get_maps_voteable = 9 command_set_maps_voteable = 10 command_get_factions_voteable = 11 command_set_factions_voteable = 12 command_get_player_respawn_as_bot = 13 command_set_player_respawn_as_bot = 14 command_get_kick_voteable = 15 command_set_kick_voteable = 16 command_get_ban_voteable = 17 command_set_ban_voteable = 18 command_get_valid_vote_ratio = 19 command_set_valid_vote_ratio = 20 command_get_auto_team_balance_limit = 21 command_set_auto_team_balance_limit = 22 command_get_starting_gold = 23 command_set_starting_gold = 24 command_get_combat_gold_bonus = 25 command_set_combat_gold_bonus = 26 command_get_round_gold_bonus = 27 command_set_round_gold_bonus = 28 command_get_player_banners_allowed = 29 command_set_player_banners_allowed = 30 command_get_force_default_armor = 31 command_set_force_default_armor = 32 command_get_team_points_gained_for_flags = 33 command_set_team_points_gained_for_flags = 34 command_get_points_gained_for_capturing_flags = 35 command_set_points_gained_for_capturing_flags = 36 command_get_map_time_limit = 37 command_set_map_time_limit = 38 command_get_team_point_limit = 39 command_set_team_point_limit = 40 command_get_defender_spawn_count = 41 command_set_defender_spawn_count = 42 command_get_disallow_ranged_weapons = 43 command_set_disallow_ranged_weapons = 44 # Napoleonic Wars commands command_use_class_limits = 50 command_class_limit_player_count = 51 command_squad_size = 52 command_scale_squad = 53 command_build_points_team1 = 54 command_build_points_team2 = 55 command_allow_multiple_firearms = 56 command_enable_bonuses = 57 command_bonus_strength = 58 command_bonus_range = 59 command_fall_off_horse = 60 command_horse_dying = 61 command_auto_kick = 62 command_max_teamkills_before_kick = 63 command_auto_horse = 64 command_auto_swap = 65 command_limit_grenadier = 66 command_limit_skirmisher = 67 command_limit_rifle = 68 command_limit_cavalry = 69 command_limit_lancer = 70 command_limit_hussar = 71 command_limit_dragoon = 72 command_limit_cuirassier = 73 command_limit_heavycav = 74 command_limit_artillery = 75 command_limit_rocket = 76 command_limit_sapper = 77 command_limit_musician = 78 command_limit_sergeant = 79 command_limit_officer = 80 command_limit_general = 81 # Hard coded commands command_get_max_players = 101 command_set_max_players = 102 command_get_friendly_fire = 103 command_set_friendly_fire = 104 command_get_melee_friendly_fire = 105 command_set_melee_friendly_fire = 106 command_get_friendly_fire_damage_self_ratio = 107 command_set_friendly_fire_damage_self_ratio = 108 command_get_friendly_fire_damage_friend_ratio = 109 command_set_friendly_fire_damage_friend_ratio = 110 command_get_ghost_mode = 111 command_set_ghost_mode = 112 command_get_control_block_direction = 113 command_set_control_block_direction = 114 command_get_combat_speed = 115 command_set_combat_speed = 116 command_get_add_to_game_servers_list = 117 command_set_add_to_game_servers_list = 118 command_get_anti_cheat = 119 command_set_anti_cheat = 120 command_get_renaming_server_allowed = 121 command_set_renaming_server_allowed = 122 command_get_changing_game_type_allowed = 123 command_set_changing_game_type_allowed = 124 command_start_scene = 130 command_open_admin_panel = 132 command_open_game_rules = 134 command_set_server_mission_timer = 136 commands_module_system_begin = command_get_bot_count commands_module_system_end = command_set_disallow_ranged_weapons + 1 commands_napoleonic_wars_begin = command_use_class_limits commands_napoleonic_wars_end = command_limit_general + 1 commands_hard_coded_begin = command_get_max_players commands_hard_coded_end = command_set_anti_cheat + 1 min_num_players = 2 max_num_players = 250 # limited by the game engine min_respawn_period = 3 max_respawn_period = 31 # dead agents are removed after approximately this interval team_default = 0 # default team, members can attack each other like deathmatch - since multiplayer is hard coded to handle only 2 teams team_spawn_invulnerable = 1 # team set to be neutral to each other and the default team, so they can't attack or be attacked team_spectators = 2 # hard coded spectators team team_bots = 3 #GGG:foreign invasion net_value_upper_bound = 1 << 31 net_sound_shift = 16 net_sound_mask = (1 << net_sound_shift) - 1 net_pack_3_shift_2 = 10 net_pack_3_shift_3 = 20 net_pack_3_value_upper_bound = 1 << net_pack_3_shift_2 net_pack_3_mask_1 = net_pack_3_value_upper_bound - 1 net_pack_3_mask_2 = net_pack_3_mask_1 << net_pack_3_shift_2 net_pack_3_mask_3 = net_pack_3_mask_1 << net_pack_3_shift_3 net_chat_type_shift = 8 net_chat_param_1_shift = net_chat_type_shift * 2 net_chat_event_mask = (1 << net_chat_type_shift) - 1 stats_chart_score_shift = 8 stats_chart_ranking_shift = 24 stats_chart_score_max = 1 << (stats_chart_ranking_shift - stats_chart_score_shift) stats_chart_player_mask = (1 << stats_chart_score_shift) - 1 admin_action_kick_player = 0 admin_action_ban_player_temp = 1 admin_action_ban_player_perm = 2 admin_action_mute_player = 3 admin_action_kill_player = 4 admin_action_fade_player_out = 5 admin_action_freeze_player = 6 #GGG:admin tools admin_action_add_outlaw_player = 7 admin_action_sub_outlaw_player = 8 admin_action_teleport_player_to_admin = 9 # admin_action_add_outlaw_player admin_action_teleport_to_player = 10 admin_action_teleport_behind_player = 11 admin_action_teleport_forwards = 12 admin_action_get_armor = 13 admin_action_get_invisible = 14 admin_action_refill_health = 15 admin_action_become_godlike = 16 admin_action_get_horse = 17 admin_action_remove_horses = 18 admin_action_remove_stray_horses = 19 #GGG:admin tools admin_action_remove_wild_animals = 20 admin_action_remove_corpses = 21 admin_action_remove_all_weapons = 21 admin_action_reset_carts = 22 # admin_action_teleport_to_ships = 23 admin_action_reset_ships = 24 admin_action_lock_faction = 25 admin_action_lock_faction_capture = 26 #GGG faction_admin_action_change_banner = 0 faction_admin_action_kick_player = 1 faction_admin_action_toggle_player_door_key = 2 faction_admin_action_toggle_player_money_key = 3 faction_admin_action_toggle_player_item_key = 4 faction_admin_action_set_relation_hostile = 5 faction_admin_action_set_relation_peaceful = 6 faction_admin_action_outlaw_player = 7 faction_admin_action_mute_player = 8 faction_admin_action_toggle_player_announce = 9 max_possible_gold = 1000000000 max_correctly_displayed_gold = 131071 # player gold over this value will not be updated correctly by the game engine max_correctly_displayed_hp = 15000 # scene prop hit points over approximately this value will not be displayed correctly in the engine hit points bar min_scene_prop_hit_points = 1 profile_banner_id_option_bits_begin = 9 profile_banner_id_option_bits_end = 30 profile_banner_id_mask = (1 << profile_banner_id_option_bits_begin) - 1 bignum = 0x40000000000000000000000000000000 op_num_value_bits = 24 + 32 tag_register = 1 tag_variable = 2 tag_string = 3 tag_item = 4 tag_troop = 5 tag_faction = 6 tag_quest = 7 tag_party_tpl = 8 tag_party = 9 tag_scene = 10 tag_mission_tpl = 11 tag_menu = 12 tag_script = 13 tag_particle_sys = 14 tag_scene_prop = 15 tag_sound = 16 tag_local_variable = 17 tag_map_icon = 18 tag_skill = 19 tag_mesh = 20 tag_presentation = 21 tag_quick_string = 22 tag_track = 23 tag_tableau = 24 tag_animation = 25 tags_end = 26 opmask_register = tag_register << op_num_value_bits opmask_variable = tag_variable << op_num_value_bits opmask_string = tag_string << op_num_value_bits opmask_item_index = tag_item << op_num_value_bits opmask_troop_index = tag_troop << op_num_value_bits opmask_faction_index = tag_faction << op_num_value_bits opmask_quest_index = tag_quest << op_num_value_bits opmask_p_template_index = tag_party_tpl << op_num_value_bits opmask_party_index = tag_party << op_num_value_bits opmask_scene_index = tag_scene << op_num_value_bits opmask_mission_tpl_index = tag_mission_tpl << op_num_value_bits opmask_menu_index = tag_menu << op_num_value_bits opmask_script = tag_script << op_num_value_bits opmask_particle_sys = tag_particle_sys << op_num_value_bits opmask_scene_prop = tag_scene_prop << op_num_value_bits opmask_sound = tag_sound << op_num_value_bits opmask_map_icon = tag_map_icon << op_num_value_bits opmask_local_variable = tag_local_variable << op_num_value_bits opmask_quick_string = tag_quick_string << op_num_value_bits def reg(reg_no): if not 0 < reg_no < 128: raise Exception("ERROR: invalid register number.") return opmask_register | reg_no s0 = 0 s1 = 1 s2 = 2 s3 = 3 s4 = 4 s5 = 5 s6 = 6 s7 = 7 s8 = 8 s9 = 9 s10 = 10 s11 = 11 s12 = 12 s13 = 13 s14 = 14 s15 = 15 s16 = 16 s17 = 17 s18 = 18 s19 = 19 s20 = 20 s21 = 21 s22 = 22 s23 = 23 s24 = 24 s25 = 25 s26 = 26 s27 = 27 s28 = 28 s29 = 29 s30 = 30 s31 = 31 s32 = 32 s33 = 33 s34 = 34 s35 = 35 s36 = 36 s37 = 37 s38 = 38 s39 = 39 s40 = 40 s41 = 41 s42 = 42 s43 = 43 s44 = 44 s45 = 45 s46 = 46 s47 = 47 s48 = 48 s49 = 49 s50 = 50 s51 = 51 s52 = 52 s53 = 53 s54 = 54 s55 = 55 s56 = 56 s57 = 57 s58 = 58 s59 = 59 s60 = 60 s61 = 61 s62 = 62 s63 = 63 s64 = 64 s65 = 65 s66 = 66 s67 = 67 s68 = 68 s69 = 69 s70 = 70 s71 = 71 s72 = 72 s73 = 73 s74 = 74 s75 = 75 s76 = 76 s77 = 77 s78 = 78 s79 = 79 s80 = 80 s81 = 81 s82 = 82 s83 = 83 s84 = 84 s85 = 85 s86 = 86 s87 = 87 s88 = 88 s89 = 89 s90 = 90 s91 = 91 s92 = 92 s93 = 93 s94 = 94 s95 = 95 s96 = 96 s97 = 97 s98 = 98 s99 = 99 s100 = 100 s101 = 101 s102 = 102 s103 = 103 s104 = 104 s105 = 105 s106 = 106 s107 = 107 s108 = 108 s109 = 109 s110 = 110 s111 = 111 s112 = 112 s113 = 113 s114 = 114 s115 = 115 s116 = 116 s117 = 117 s118 = 118 s119 = 119 s120 = 120 s121 = 121 s122 = 122 s123 = 123 s124 = 124 s125 = 125 s126 = 126 s127 = 127 pos0 = 0 pos1 = 1 pos2 = 2 pos3 = 3 pos4 = 4 pos5 = 5 pos6 = 6 pos7 = 7 pos8 = 8 pos9 = 9 pos10 = 10 pos11 = 11 pos12 = 12 pos13 = 13 pos14 = 14 pos15 = 15 pos16 = 16 pos17 = 17 pos18 = 18 pos19 = 19 pos20 = 20 pos21 = 21 pos22 = 22 pos23 = 23 pos24 = 24 pos25 = 25 pos26 = 26 pos27 = 27 pos28 = 28 pos29 = 29 pos30 = 30 pos31 = 31 pos32 = 32 pos33 = 33 pos34 = 34 pos35 = 35 pos36 = 36 pos37 = 37 pos38 = 38 pos39 = 39 pos40 = 40 pos41 = 41 pos42 = 42 pos43 = 43 pos44 = 44 pos45 = 45 pos46 = 46 pos47 = 47 pos48 = 48 pos49 = 49 pos50 = 50 pos51 = 51 pos52 = 52 pos53 = 53 pos54 = 54 pos55 = 55 pos56 = 56 pos57 = 57 pos58 = 58 pos59 = 59 pos60 = 60 pos61 = 61 pos62 = 62 pos63 = 63 pos64 = 64 pos65 = 65 pos66 = 66 pos67 = 67 pos68 = 68 pos69 = 69 pos70 = 70 pos71 = 71 pos72 = 72 pos73 = 73 pos74 = 74 pos75 = 75 pos76 = 76 pos77 = 77 pos78 = 78 pos79 = 79 pos80 = 80 pos81 = 81 pos82 = 82 pos83 = 83 pos84 = 84 pos85 = 85 pos86 = 86 pos87 = 87 pos88 = 88 pos89 = 89 pos90 = 90 pos91 = 91 pos92 = 92 pos93 = 93 pos94 = 94 pos95 = 95 pos96 = 96 pos97 = 97 pos98 = 98 pos99 = 99 pos100 = 100 pos101 = 101 pos102 = 102 pos103 = 103 pos104 = 104 pos105 = 105 pos106 = 106 pos107 = 107 pos108 = 108 pos109 = 109 pos110 = 110 pos111 = 111 pos112 = 112 pos113 = 113 pos114 = 114 pos115 = 115 pos116 = 116 pos117 = 117 pos118 = 118 pos119 = 119 pos120 = 120 pos121 = 121 pos122 = 122 pos123 = 123 pos124 = 124 pos125 = 125 pos126 = 126 pos127 = 127 reg0 = opmask_register| 0 reg1 = opmask_register| 1 reg2 = opmask_register| 2 reg3 = opmask_register| 3 reg4 = opmask_register| 4 reg5 = opmask_register| 5 reg6 = opmask_register| 6 reg7 = opmask_register| 7 reg8 = opmask_register| 8 reg9 = opmask_register| 9 reg10 = opmask_register|10 reg11 = opmask_register|11 reg12 = opmask_register|12 reg13 = opmask_register|13 reg14 = opmask_register|14 reg15 = opmask_register|15 reg16 = opmask_register|16 reg17 = opmask_register|17 reg18 = opmask_register|18 reg19 = opmask_register|19 reg20 = opmask_register|20 reg21 = opmask_register|21 reg22 = opmask_register|22 reg23 = opmask_register|23 reg24 = opmask_register|24 reg25 = opmask_register|25 reg26 = opmask_register|26 reg27 = opmask_register|27 reg28 = opmask_register|28 reg29 = opmask_register|29 reg30 = opmask_register|30 reg31 = opmask_register|31 reg32 = opmask_register|32 reg33 = opmask_register|33 reg34 = opmask_register|34 reg35 = opmask_register|35 reg36 = opmask_register|36 reg37 = opmask_register|37 reg38 = opmask_register|38 reg39 = opmask_register|39 reg40 = opmask_register|40 reg41 = opmask_register|41 reg42 = opmask_register|42 reg43 = opmask_register|43 reg44 = opmask_register|44 reg45 = opmask_register|45 reg46 = opmask_register|46 reg47 = opmask_register|47 reg48 = opmask_register|48 reg49 = opmask_register|49 reg50 = opmask_register|50 reg51 = opmask_register|51 reg52 = opmask_register|52 reg53 = opmask_register|53 reg54 = opmask_register|54 reg55 = opmask_register|55 reg56 = opmask_register|56 reg57 = opmask_register|57 reg58 = opmask_register|58 reg59 = opmask_register|59 reg60 = opmask_register|60 reg61 = opmask_register|61 reg62 = opmask_register|62 reg63 = opmask_register|63 reg64 = opmask_register|64 reg65 = opmask_register|65 reg66 = opmask_register|66 reg67 = opmask_register|67 reg68 = opmask_register|68 reg69 = opmask_register|69 reg70 = opmask_register|70 reg71 = opmask_register|71 reg72 = opmask_register|72 reg73 = opmask_register|73 reg74 = opmask_register|74 reg75 = opmask_register|75 reg76 = opmask_register|76 reg77 = opmask_register|77 reg78 = opmask_register|78 reg79 = opmask_register|79 reg80 = opmask_register|80 reg81 = opmask_register|81 reg82 = opmask_register|82 reg83 = opmask_register|83 reg84 = opmask_register|84 reg85 = opmask_register|85 reg86 = opmask_register|86 reg87 = opmask_register|87 reg88 = opmask_register|88 reg89 = opmask_register|89 reg90 = opmask_register|90 reg91 = opmask_register|91 reg92 = opmask_register|92 reg93 = opmask_register|93 reg94 = opmask_register|94 reg95 = opmask_register|95 reg96 = opmask_register|96 reg97 = opmask_register|97 reg98 = opmask_register|98 reg99 = opmask_register|99 reg100 = opmask_register|100 reg101 = opmask_register|101 reg102 = opmask_register|102 reg103 = opmask_register|103 reg104 = opmask_register|104 reg105 = opmask_register|105 reg106 = opmask_register|106 reg107 = opmask_register|107 reg108 = opmask_register|108 reg109 = opmask_register|109 reg110 = opmask_register|110 reg111 = opmask_register|111 reg112 = opmask_register|112 reg113 = opmask_register|113 reg114 = opmask_register|114 reg115 = opmask_register|115 reg116 = opmask_register|116 reg117 = opmask_register|117 reg118 = opmask_register|118 reg119 = opmask_register|119 reg120 = opmask_register|120 reg121 = opmask_register|121 reg122 = opmask_register|122 reg123 = opmask_register|123 reg124 = opmask_register|124 reg125 = opmask_register|125 reg126 = opmask_register|126 reg127 = opmask_register|127 spf_all_teams_are_enemy = 0x00000001 spf_is_horseman = 0x00000002 spf_examine_all_spawn_points = 0x00000004 spf_team_0_spawn_far_from_entry_32 = 0x00000008 spf_team_1_spawn_far_from_entry_0 = 0x00000010 spf_team_1_spawn_far_from_entry_66 = 0x00000020 spf_team_0_spawn_near_entry_0 = 0x00000040 spf_team_0_spawn_near_entry_66 = 0x00000080 spf_team_1_spawn_near_entry_32 = 0x00000100 spf_team_0_walkers_spawn_at_high_points = 0x00000200 spf_team_1_walkers_spawn_at_high_points = 0x00000400 spf_try_to_spawn_close_to_at_least_one_enemy = 0x00000800 spf_care_agent_to_agent_distances_less = 0x00001000 # Human bones hb_abdomen = 0 hb_thigh_l = 1 hb_calf_l = 2 hb_foot_l = 3 hb_thigh_r = 4 hb_calf_r = 5 hb_foot_r = 6 hb_spine = 7 hb_thorax = 8 hb_head = 9 hb_shoulder_l = 10 hb_upperarm_l = 11 hb_forearm_l = 12 hb_hand_l = 13 hb_item_l = 14 hb_shoulder_r = 15 hb_upperarm_r = 16 hb_forearm_r = 17 hb_hand_r = 18 hb_item_r = 19 # Horse bones hrsb_pelvis = 0 hrsb_spine_1 = 1 hrsb_spine_2 = 2 hrsb_spine_3 = 3 hrsb_neck_1 = 4 hrsb_neck_2 = 5 hrsb_neck_3 = 6 hrsb_head = 7 hrsb_l_clavicle = 8 hrsb_l_upper_arm = 9 hrsb_l_forearm = 10 hrsb_l_hand = 11 hrsb_l_front_hoof = 12 hrsb_r_clavicle = 13 hrsb_r_upper_arm = 14 hrsb_r_forearm = 15 hrsb_r_hand = 16 hrsb_r_front_hoof = 17 hrsb_l_thigh = 18 hrsb_l_calf = 19 hrsb_l_foot = 20 hrsb_l_back_hoof = 21 hrsb_r_thigh = 22 hrsb_r_calf = 23 hrsb_r_foot = 24 hrsb_r_back_hoof = 25 hrsb_tail_1 = 26 hrsb_tail_2 = 27 #Tooltip types tooltip_agent = 1 tooltip_horse = 2 tooltip_my_horse = 3 tooltip_container = 5 tooltip_door = 6 tooltip_item = 7 tooltip_leave_area = 8 tooltip_prop = 9 tooltip_destructible_prop = 10 #Human bones hb_abdomen = 0 hb_thigh_l = 1 hb_calf_l = 2 hb_foot_l = 3 hb_thigh_r = 4 hb_calf_r = 5 hb_foot_r = 6 hb_spine = 7 hb_thorax = 8 hb_head = 9 hb_shoulder_l = 10 hb_upperarm_l = 11 hb_forearm_l = 12 hb_hand_l = 13 hb_item_l = 14 hb_shoulder_r = 15 hb_upperarm_r = 16 hb_forearm_r = 17 hb_hand_r = 18 hb_item_r = 19 #Horse bones hrsb_pelvis = 0 hrsb_spine_1 = 1 hrsb_spine_2 = 2 hrsb_spine_3 = 3 hrsb_neck_1 = 4 hrsb_neck_2 = 5 hrsb_neck_3 = 6 hrsb_head = 7 hrsb_l_clavicle = 8 hrsb_l_upper_arm = 9 hrsb_l_forearm = 10 hrsb_l_hand = 11 hrsb_l_front_hoof = 12 hrsb_r_clavicle = 13 hrsb_r_upper_arm = 14 hrsb_r_forearm = 15 hrsb_r_hand = 16 hrsb_r_front_hoof = 17 hrsb_l_thigh = 18 hrsb_l_calf = 19 hrsb_l_foot = 20 hrsb_l_back_hoof = 21 hrsb_r_thigh = 22 hrsb_r_calf = 23 hrsb_r_foot = 24 hrsb_r_back_hoof = 25 hrsb_tail_1 = 26 hrsb_tail_2 = 27 #Attack directions atk_thrust = 0 atk_right_swing = 1 atk_left_swing = 2 atk_overhead = 3 #Game windows window_inventory = 7 window_party = 8 window_character = 11 #Agent body meta meshes bmm_head = 0 bmm_beard = 1 bmm_hair = 2 bmm_helmet = 3 bmm_armor = 4 bmm_trousers = 5 bmm_left_foot = 6 bmm_right_foot = 7 bmm_armature = 8 bmm_item_1 = 9 bmm_item_2 = 10 bmm_item_3 = 11 bmm_item_4 = 12 bmm_missile_1 = 13 bmm_missile_2 = 14 bmm_missile_3 = 15 bmm_missile_4 = 16 bmm_carry_1 = 17 bmm_carry_2 = 18 bmm_carry_3 = 19 bmm_carry_4 = 20 bmm_unknown_2 = 21 bmm_left_hand = 22 bmm_right_hand = 23 bmm_left_bracer = 24 bmm_right_bracer = 25 bmm_banner = 26 bmm_name = 27 #Floating point registers fp0 = 0 fp1 = 1 fp2 = 2 fp3 = 3 fp4 = 4 fp5 = 5 fp6 = 6 fp7 = 7 fp8 = 8 fp9 = 9 fp10 = 10 fp11 = 11 fp12 = 12 fp13 = 13 fp14 = 14 fp15 = 15 fp16 = 16 fp17 = 17 fp18 = 18 fp19 = 19 fp20 = 20 fp21 = 21 fp22 = 22 fp23 = 23 fp24 = 24 fp25 = 25 fp26 = 26 fp27 = 27 fp28 = 28 fp29 = 29 fp30 = 30 fp31 = 31 fp32 = 32 fp33 = 33 fp34 = 34 fp35 = 35 fp36 = 36 fp37 = 37 fp38 = 38 fp39 = 39 fp40 = 40 fp41 = 41 fp42 = 42 fp43 = 43 fp44 = 44 fp45 = 45 fp46 = 46 fp47 = 47 fp48 = 48 fp49 = 49 fp50 = 50 fp51 = 51 fp52 = 52 fp53 = 53 fp54 = 54 fp55 = 55 fp56 = 56 fp57 = 57 fp58 = 58 fp59 = 59 fp60 = 60 fp61 = 61 fp62 = 62 fp63 = 63 fp64 = 64 fp65 = 65 fp66 = 66 fp67 = 67 fp68 = 68 fp69 = 69 fp70 = 70 fp71 = 71 fp72 = 72 fp73 = 73 fp74 = 74 fp75 = 75 fp76 = 76 fp77 = 77 fp78 = 78 fp79 = 79 fp80 = 80 fp81 = 81 fp82 = 82 fp83 = 83 fp84 = 84 fp85 = 85 fp86 = 86 fp87 = 87 fp88 = 88 fp89 = 89 fp90 = 90 fp91 = 91 fp92 = 92 fp93 = 93 fp94 = 94 fp95 = 95 fp96 = 96 fp97 = 97 fp98 = 98 fp99 = 99 fp100 = 100 fp101 = 101 fp102 = 102 fp103 = 103 fp104 = 104 fp105 = 105 fp106 = 106 fp107 = 107 fp108 = 108 fp109 = 109 fp110 = 110 fp111 = 111 fp112 = 112 fp113 = 113 fp114 = 114 fp115 = 115 fp116 = 116 fp117 = 117 fp118 = 118 fp119 = 119 fp120 = 120 fp121 = 121 fp122 = 122 fp123 = 123 fp124 = 124 fp125 = 125 fp126 = 126 fp127 = 127 sort_f_desc = 1 sort_f_ci = 2 sort_m_int_asc = 0 sort_m_int_desc = sort_f_desc sort_m_str_cs_asc = 0 sort_m_str_cs_desc = sort_f_desc sort_m_str_ci_asc = sort_f_ci sort_m_str_ci_desc = sort_f_ci | sort_f_desc LUA_TNONE = -1 LUA_TNIL = 0 LUA_TBOOLEAN = 1 LUA_TLIGHTUSERDATA = 2 LUA_TNUMBER = 3 LUA_TSTRING = 4 LUA_TTABLE = 5 LUA_TFUNCTION = 6 LUA_TUSERDATA = 7 LUA_TTHREAD = 8
# -*- coding: utf-8 -*- """ Created on Tue Feb 1 09:38:18 2022 @author: JHOSS """ #CONTAR LOS NUMEROS PRIMOS DEL 1 AL 100 num = 1 while num <=100: cont =1 x=0 while cont <= num: if num % cont == 0: x=x+1 cont = cont +1 if x==2: print(num) num = num +1
## class <nombre_del_objeto>: ## def <metodo_del_objeto>(self): # variable -> atributos # funciones -> metodos def hola(): print("hola a todos") hola() class Persona: def __init__(self, nombre): self.nombre = nombre def hola(self): print("Hola a todos, soy", self.nombre) def agregarApellido(self, apellido): self.apellido = apellido def agregarEdad(self, edad): self.edad = edad def __str__(self): return self.nombre class Animal: def __init__(self, nombre): self.nombre = nombre perro = Animal('perro') perro.edad = 12 perro.raza = 'labrador' luis = Persona('Luis') luis.hola() luis.agregarApellido('Perez') pedro = Persona('Pedro') pedro.hola() pedro.agregarEdad(17) print(pedro) pedro.nombre = 'Pablo' print(pedro) print(pedro.edad) pedro.edad = 19 print(pedro.edad)
# # PySNMP MIB module CISCO-IETF-SCTP-EXT-CAPABILITY (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-IETF-SCTP-EXT-CAPABILITY # Produced by pysmi-0.3.4 at Wed May 1 12:01:04 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # OctetString, ObjectIdentifier, Integer = mibBuilder.importSymbols("ASN1", "OctetString", "ObjectIdentifier", "Integer") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") SingleValueConstraint, ConstraintsIntersection, ValueSizeConstraint, ConstraintsUnion, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ConstraintsIntersection", "ValueSizeConstraint", "ConstraintsUnion", "ValueRangeConstraint") ciscoAgentCapability, = mibBuilder.importSymbols("CISCO-SMI", "ciscoAgentCapability") NotificationGroup, AgentCapabilities, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "AgentCapabilities", "ModuleCompliance") iso, ObjectIdentity, TimeTicks, Gauge32, Bits, MibScalar, MibTable, MibTableRow, MibTableColumn, Counter64, NotificationType, Counter32, Unsigned32, IpAddress, Integer32, ModuleIdentity, MibIdentifier = mibBuilder.importSymbols("SNMPv2-SMI", "iso", "ObjectIdentity", "TimeTicks", "Gauge32", "Bits", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Counter64", "NotificationType", "Counter32", "Unsigned32", "IpAddress", "Integer32", "ModuleIdentity", "MibIdentifier") DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention") ciscoSctpExtCapability = ModuleIdentity((1, 3, 6, 1, 4, 1, 9, 7, 220)) ciscoSctpExtCapability.setRevisions(('2002-01-21 00:00', '2001-11-30 00:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: ciscoSctpExtCapability.setRevisionsDescriptions(('Updated capabilities to support additional objects and a new notification.', 'Initial version of this MIB module.',)) if mibBuilder.loadTexts: ciscoSctpExtCapability.setLastUpdated('200201210000Z') if mibBuilder.loadTexts: ciscoSctpExtCapability.setOrganization('Cisco Systems, Inc.') if mibBuilder.loadTexts: ciscoSctpExtCapability.setContactInfo(' Cisco Systems Customer Service Postal: 170 West Tasman Drive San Jose, CA 95134 USA Tel: +1 800 553-NETS E-mail: cs-sctp@cisco.com') if mibBuilder.loadTexts: ciscoSctpExtCapability.setDescription('Agent capabilities for the CISCO-IETF-SCTP-EXT-MIB.') ciscoSctpExtCapabilityV12R024MB1 = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 220, 1)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ciscoSctpExtCapabilityV12R024MB1 = ciscoSctpExtCapabilityV12R024MB1.setProductRelease('Cisco IOS 12.2(4)MB1') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ciscoSctpExtCapabilityV12R024MB1 = ciscoSctpExtCapabilityV12R024MB1.setStatus('current') if mibBuilder.loadTexts: ciscoSctpExtCapabilityV12R024MB1.setDescription('IOS 12.2(4)MB1 Cisco CISCO-IETF-SCTP-EXT-MIB.my User Agent MIB capabilities.') ciscoSctpExtCapabilityV12R0204MB3 = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 220, 2)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ciscoSctpExtCapabilityV12R0204MB3 = ciscoSctpExtCapabilityV12R0204MB3.setProductRelease('Cisco IOS 12.2(4)MB3') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ciscoSctpExtCapabilityV12R0204MB3 = ciscoSctpExtCapabilityV12R0204MB3.setStatus('current') if mibBuilder.loadTexts: ciscoSctpExtCapabilityV12R0204MB3.setDescription('IOS 12.2(4)MB3 Cisco CISCO-IETF-SCTP-EXT-MIB.my User Agent MIB capabilities.') mibBuilder.exportSymbols("CISCO-IETF-SCTP-EXT-CAPABILITY", ciscoSctpExtCapability=ciscoSctpExtCapability, PYSNMP_MODULE_ID=ciscoSctpExtCapability, ciscoSctpExtCapabilityV12R024MB1=ciscoSctpExtCapabilityV12R024MB1, ciscoSctpExtCapabilityV12R0204MB3=ciscoSctpExtCapabilityV12R0204MB3)
def first_last(s1): # [out of bound error] s2 = s1[0] + s1[1] + s1[4] + s1[5] # [out of bound error] s2 = s1[0] + s1[1] + s1[-2] + s1[-1] # [false result] s2 = s1[0:2] + s1[-2:-1] s2 = s1[0:2] + s1[-2:] # [out of bound error] s2 = s1[:2] + s1[-2] return s2 print(first_last("spring")) print(first_last("hello")) print(first_last("a")) print(first_last("abc"))
ref = [ "A00002", "A00005", "A10001", "A10002", "A10003", "A10004", "A10005", "A10006", "A10007", "A10008", "A10009", "A10010", "A10011", "A10012", "A10013", "A10014", "A10015", "A10016", "A10017", "A10018", "A10019", "A10020", "A10021", "A10022", "A10023", "A10024", "A10025", "A10026", "A10027", "A10028", "A10029", "A10030", "A10031", "A10032", "A10033", "A10034", "A10035", "A10036", "A10037", "A10038", "A10039", "A10040", "A10041", "A10042", "A10043", "A10044", "A10045", "A10046", "A10047", "A10048", "A10049", "A10050", "A10051", "A10052", "A10053", "A10054", "A10055", "A10056", "A10057", "A10058", "A10059", "A10060", "A10061", "A10062", "A10063", "A10064", "A10065", "A10066", "A10067", "A10068", "A10069", "A10070", "A10071", "A10072", "A10073", "A10074", "A10075", "A10076", "A10077", "A10078", "A10079", "A10080", "A10081", "A10082", "A10083", "A10084", "A10085", "A10086", "A10087", "A10088", "A10089", "A10090", "A10091", "A10092", "A10093", "A10094", "A10095", "A10096", "A10097", "A10098", "A10099", "A10100", "A10101", "A10102", "A10103", "A10104", "A10105", "A10106", "A10107", "A10108", "A10109", "A10110", "A10111", "A10112", "A10113", "A10114", "A10115", "A10116", "A10117", "A10118", "A10119", "A10120", "A10121", "A10122", "A10123", "A10124", "A10125", "A10150", "A10151", "A10152", "A10153", "A10154", "A10155", "A10156", "A10157", "A10158", "A10159", "A10160", "A10161", "A10162", "A10163", "A10164", "A10165", "A10166", "A10167", "A10168", "A10169", "A10170", "A10171", "A10172", "A10173", "A10174", "A10175", "A10176", "A10177", "A10178", "A10179", "A10180", "A10181", "A10182", "A10183", "A10184", "A10185", "A10186", "A10187", "A10188", "A10189", "A10190", "A10191", "A10192", "A10193", "A10194", "A10195", "A10196", "A10197", "A10198", "A10199", "A10201", "A10202", "A10203", "A10204", "A10205", "A10206", "A10207", "A10210", "A15501", "A15502", "A20000", "A20001", "A20002", "A20003", "A20004", "A20005", "A20006", "A20007", "A20008", "A20009", "A20010", "A20011", "A20012", "A20013", "A20014", "A20015", "A20016", "A20017", "A20018", "A20019", "A20020", "A20021", "A20022", "A20023", "A20024", "A20025", "A20026", "A20027", "A20028", "A20030", "A20031", "A20032", "A20033", "A20034", "A20035", "A20043", "A20044", "A20045", "A20046", "A20047", "A20052", "A20053", "A20055", "A20056", "A20058", "A20060", "A20062", "A20063", "A20065", "A20066", "A20067", "A20074", "A20076", "A20079", "A20092", "A20093", "A20094", "A20095", "A20096", "A20097", "A20098", "A20099", "A20101", "A20102", "A20103", "A20104", "A20105", "A20106", "A20107", "A20127", "A20130", "A20135", "A20140", "A20145", "A20150", "A20200", "A20201", "A20202", "A20203", "A20204", "A20205", "A20206", "A20207", "A20208", "A20209", "A20210", "A20211", "A20212", "A20213", "A20214", "A20215", "A20216", "A20217", "A20218", "A20219", "A20220", "A20221", "A20222", "A20223", "A20224", "A20225", "A20226", "A20227", "A20228", "A20229", "A20230", "A20231", "A20232", "A20233", "A20234", "A20235", "A20236", "A20237", "A20238", "A20239", "A20240", "A20241", "A20242", "A20243", "A20244", "A20245", "A20246", "A20247", "A20248", "A20249", "A20250", "A20251", "A20252", "A20253", "A20254", "A20255", "A20256", "A20257", "A20258", "A20259", "A20260", "A20261", "A20262", "A20263", "A20264", "A20265", "A20266", "A20267", "A20268", "A20269", "A20270", "A20271", "A20272", "A20273", "A20274", "A20275", "A20276", "A20277", "A20278", "A20279", "A20280", "A20281", "A20282", "A20283", "A20284", "A20285", "A20286", "A20287", "A20288", "A20289", "A20290", "A20291", "A20292", "A20293", "A20294", "A20295", "A20296", "A20297", "A20298", "A20299", "A20300", "A20301", "A20302", "A20303", "A20304", "A20305", "A20306", "A20307", "A20308", "A20309", "A20310", "A20311", "A20312", "A20313", "A20314", "A20315", "A20316", "A20317", "A20318", "A20319", "A20320", "A20321", "A20322", "A20323", "A20324", "A20325", "A20326", "A20327", "A20328", "A20329", "A20330", "A20331", "A20332", "A20333", "A20334", "A20335", "A20336", "A20337", "A20338", "A20339", "A20340", "A20341", "A20342", "A20343", "A20344", "A20345", "A20346", "A20347", "A20348", "A20349", "A20350", "A20351", "A20352", "A20353", "A20354", "A20355", "A20356", "A20357", "A20358", "A20359", "A20360", "A20361", "A20362", "A20363", "A20364", "A20365", "A20366", "A20367", "A20368", "A20369", "A20370", "A20371", "A20372", "A20373", "A20374", "A20375", "A20376", "A20377", "A20378", "A20379", "A20380", "A20381", "A20382", "A20383", "A20384", "A20385", "A20386", "A20387", "A20388", "A20389", "A20390", "A20391", "A20392", "A20393", "A20394", "A20395", "A20396", "A20397", "A20398", "A20399", "A20400", "A20401", "A20402", "A20403", "A20405", "A20406", "A20407", "A20408", "A20409", "A20410", "A20411", "A20412", "A20413", "A20414", "A20415", "A20416", "A20417", "A20418", "A20419", "A20420", "A20421", "A20422", "A20423", "A20424", "A20425", "A20426", "A20427", "A20428", "A20429", "A20430", "A20431", "A20432", "A20433", "A20434", "A20435", "A20436", "A20437", "A20438", "A20440", "A20441", "A20442", "A20443", "A20444", "A20445", "A20446", "A20447", "A20448", "A20449", "A20450", "A20451", "A20452", "A20453", "A20454", "A20455", "A20456", "A20458", "A20459", "A20460", "A20461", "A20462", "A20463", "A20464", "A20465", "A20466", "A20467", "A20468", "A20469", "A20470", "A20471", "A20472", "A20473", "A20474", "A20475", "A20476", "A20477", "A20478", "A20479", "A20480", "A20481", "A20482", "A20483", "A20484", "A20485", "A20486", "A20487", "A20488", "A20489", "A20490", "A20491", "A20492", "A20493", "A20494", "A20495", "A20496", "A20497", "A20498", "A20499", "A20650", "A20651", "A20652", "A20653", "A20654", "A20655", "A20656", "A20657", "A20658", "A20659", "A20660", "A20661", "A20662", "A20663", "A20664", "A20665", "A20666", "A20667", "A20668", "A20669", "A20670", "A20671", "A20672", "A20673", "A20674", "A20675", "A20676", "A20677", "A20678", "A20679", "A20680", "A20681", "A20682", "A20683", "A20684", "A20685", "A20686", "A20687", "A20688", "A20689", "A20690", "A20691", "A20693", "A20694", "A20695", "A20696", "A20697", "A20698", "A20699", "A20700", "A20701", "A20702", "A20703", "A20704", "A20705", "A20706", "A20707", "A20708", "A20709", "A20710", "A20711", "A20712", "A20713", "A20714", "A20715", "A20716", "A20717", "A20718", "A20719", "A20720", "A20721", "A20722", "A20723", "A20724", "A20725", "A20726", "A20727", "A20728", "A20729", "A20730", "A20731", "A20732", "A20734", "A20735", "A20736", "A20737", "A20738", "A20739", "A20740", "A20741", "A20742", "A20743", "A20744", "A20745", "A20746", "A20747", "A20748", "A20749", "A20750", "A20751", "A20752", "A20753", "A20754", "A20755", "A20756", "A20757", "A20758", "A20759", "A20760", "A20761", "A20762", "A20763", "A20764", "A20765", "A20766", "A20767", "A20768", "A20769", "A20770", "A20771", "A20772", "A20773", "A20774", "A20775", "A20776", "A20777", "A20778", "A20779", "A20780", "A20781", "A20782", "A20783", "A20784", "A20785", "A20786", "A20787", "A20788", "A20789", "A20790", "A20791", "A20792", "A20793", "A20794", "A20795", "A20796", "A20797", "A20798", "A20799", "A20800", "A20801", "A20802", "A20803", "A20804", "A20805", "A20806", "A20807", "A20808", "A20809", "A20810", "A20811", "A20812", "A20813", "A20814", "A20815", "A20816", "A20817", "A20818", "A20819", "A20820", "A20821", "A20822", "A20823", "A20824", "A20825", "A20826", "A20827", "A20828", "A20829", "A20830", "A20831", "A20832", "A20833", "A20834", "A20835", "A20836", "A20837", "A20838", "A20839", "A20840", "A20841", "A20842", "A20843", "A20844", "A20845", "A20846", "A20847", "A20848", "A20849", "A20850", "A20851", "A20852", "A20853", "A20854", "A20855", "A20856", "A20857", "A21099", "A21163", "A21164", "A21165", "A21166", "A21172", "A21173", "A21174", "A21175", "A21176", "A21177", "A21178", "A21180", "A21181", "A21182", "A21183", "A21184", "A21185", "A21186", "A21187", "A21199", "A21202", "A21203", "A21204", "A21205", "A21206", "A21207", "A21208", "A21209", "A21210", "A21211", "A21215", "A21216", "A21217", "A21218", "A21219", "A21220", "A21225", "A21226", "A21229", "A21230", "A21235", "A21244", "A21245", "A21246", "A21247", "A21248", "A21249", "A21254", "A21257", "A21261", "A21262", "A21270", "A21271", "A21292", "A21293", "A21294", "A21295", "A21296", "A21297", "A21299", "A21401", "A21402", "A21405", "A21410", "A21412", "A21413", "A21425", "A21426", "A21427", "A21428", "A21429", "A21431", "A21433", "A21434", "A21435", "A21436", "A21461", "A21463", "A21464", "A21465", "A21467", "A21468", "A21471", "A21472", "A21473", "A21474", "A21475", "A21476", "A21477", "A21479", "A21484", "A21490", "A21998", "A22020", "A22265", "A22266", "A22267", "A22268", "A22269", "A22270", "A22271", "A22272", "A22273", "A22274", "A22275", "A22276", "A22277", "A22279", "A22283", "A22289", "A22290", "A22291", "A22300", "A22301", "A22302", "A22303", "A22304", "A22305", "A22306", "A22307", "A22308", "A22309", "A22310", "A22311", "A22312", "A22313", "A22314", "A22315", "A22316", "A22317", "A22318", "A22319", "A22320", "A22321", "A22322", "A22323", "A22324", "A22325", "A22326", "A22327", "A22328", "A22329", "A22330", "A22331", "A22332", "A22333", "A22334", "A22335", "A22336", "A22337", "A22338", "A22339", "A22340", "A22341", "A22342", "A22343", "A22344", "A22345", "A22346", "A22347", "A22348", "A22349", "A22350", "A22351", "A22352", "A22353", "A22354", "A22355", "A22356", "A22357", "A22358", "A22359", "A22360", "A22361", "A22362", "A22363", "A22364", "A22365", "A22366", "A22367", "A22368", "A22369", "A22370", "A22371", "A22372", "A22373", "A22374", "A22375", "A22376", "A22377", "A22378", "A22379", "A22380", "A22381", "A22382", "A22383", "A22384", "A22385", "A22386", "A22387", "A22388", "A22389", "A22390", "A22391", "A22392", "A22393", "A22394", "A22395", "A22396", "A22397", "A22398", "A22399", "A22400", "A22401", "A22601", "A23020", "A23571", "A24185", "A24264", "A24379", "A24595", "A24701", "A24915", "A25630", "A25736", "A26201", "A26543", "A26611", "A26684", "A26990", "A27003", "A27185", "A27593", "A27691", "A27915", "A28009", "A28097", "A28394", "A28492", "A28665", "A28741", "A28830", "A28947", "A29252", "A29271", "A29344", "A29434", "A29586", "A29683", "A29792", "A29811", "A29812", "A29813", "A80016", "A81001", "A81002", "A81003", "A81004", "A81005", "A81006", "A81007", "A81008", "A81009", "A81010", "A81011", "A81012", "A81013", "A81014", "A81015", "A81016", "A81017", "A81018", "A81019", "A81020", "A81021", "A81022", "A81023", "A81025", "A81026", "A81027", "A81029", "A81030", "A81031", "A81032", "A81033", "A81034", "A81035", "A81036", "A81037", "A81038", "A81039", "A81040", "A81041", "A81042", "A81043", "A81044", "A81045", "A81046", "A81047", "A81048", "A81049", "A81051", "A81052", "A81053", "A81054", "A81055", "A81056", "A81057", "A81058", "A81060", "A81061", "A81063", "A81064", "A81065", "A81066", "A81067", "A81068", "A81069", "A81070", "A81071", "A81602", "A81605", "A81608", "A81609", "A81610", "A81611", "A81612", "A81613", "A81616", "A81618", "A81620", "A81621", "A81622", "A81623", "A81625", "A81627", "A81629", "A81630", "A81631", "A81632", "A81633", "A81634", "A82001", "A82003", "A82004", "A82005", "A82006", "A82007", "A82008", "A82009", "A82010", "A82011", "A82012", "A82013", "A82014", "A82015", "A82016", "A82017", "A82018", "A82019", "A82020", "A82021", "A82022", "A82023", "A82024", "A82025", "A82026", "A82027", "A82028", "A82029", "A82030", "A82031", "A82032", "A82033", "A82034", "A82035", "A82036", "A82037", "A82038", "A82039", "A82040", "A82041", "A82042", "A82044", "A82045", "A82046", "A82047", "A82048", "A82049", "A82050", "A82052", "A82053", "A82055", "A82056", "A82057", "A82058", "A82060", "A82061", "A82062", "A82063", "A82064", "A82065", "A82068", "A82070", "A82071", "A82072", "A82074", "A82075", "A82077", "A82502", "A82607", "A82608", "A82609", "A82613", "A82614", "A82615", "A82616", "A82617", "A82618", "A82619", "A82620", "A82621", "A82622", "A82623", "A82624", "A82625", "A82627", "A82629", "A82630", "A82631", "A82632", "A82635", "A82636", "A82641", "A82642", "A82645", "A82646", "A82647", "A82648", "A82649", "A82650", "A82651", "A82654", "A83001", "A83003", "A83004", "A83005", "A83006", "A83007", "A83008", "A83009", "A83010", "A83011", "A83012", "A83013", "A83014", "A83015", "A83016", "A83017", "A83018", "A83019", "A83020", "A83021", "A83022", "A83023", "A83024", "A83025", "A83026", "A83027", "A83028", "A83029", "A83030", "A83031", "A83032", "A83033", "A83034", "A83035", "A83036", "A83037", "A83038", "A83040", "A83041", "A83042", "A83043", "A83044", "A83045", "A83046", "A83047", "A83048", "A83049", "A83050", "A83051", "A83052", "A83054", "A83055", "A83057", "A83060", "A83061", "A83066", "A83068", "A83070", "A83071", "A83072", "A83073", "A83074", "A83075", "A83076", "A83603", "A83610", "A83616", "A83617", "A83618", "A83619", "A83622", "A83626", "A83627", "A83630", "A83632", "A83634", "A83635", "A83636", "A83637", "A83638", "A83641", "A83642", "A83644", "A84002", "A84003", "A84005", "A84006", "A84007", "A84008", "A84009", "A84011", "A84013", "A84014", "A84015", "A84016", "A84018", "A84020", "A84021", "A84022", "A84024", "A84025", "A84026", "A84027", "A84028", "A84029", "A84030", "A84031", "A84032", "A84033", "A84034", "A84035", "A84036", "A84037", "A84038", "A84039", "A84040", "A84042", "A84043", "A84044", "A84045", "A84047", "A84048", "A84604", "A84609", "A84613", "A84614", "A84619", "A85001", "A85002", "A85003", "A85004", "A85005", "A85006", "A85007", "A85008", "A85009", "A85010", "A85011", "A85012", "A85013", "A85014", "A85015", "A85016", "A85017", "A85018", "A85019", "A85020", "A85021", "A85023", "A85024", "A85025", "A85026", "A85601", "A85605", "A85609", "A85611", "A85614", "A85615", "A85616", "A85617", "A85618", "A85619", "A85620", "A85621", "A86003", "A86004", "A86005", "A86006", "A86007", "A86008", "A86009", "A86010", "A86011", "A86012", "A86013", "A86015", "A86016", "A86017", "A86018", "A86020", "A86021", "A86022", "A86023", "A86024", "A86025", "A86026", "A86027", "A86028", "A86029", "A86030", "A86031", "A86033", "A86035", "A86036", "A86037", "A86038", "A86040", "A86041", "A86601", "A86608", "A86612", "A86618", "A87002", "A87003", "A87004", "A87005", "A87006", "A87007", "A87008", "A87009", "A87011", "A87012", "A87013", "A87014", "A87015", "A87016", "A87017", "A87019", "A87020", "A87022", "A87023", "A87027", "A87029", "A87030", "A87600", "A87604", "A87608", "A87612", "A87615", "A88001", "A88002", "A88003", "A88004", "A88005", "A88006", "A88007", "A88008", "A88009", "A88010", "A88011", "A88012", "A88013", "A88014", "A88015", "A88016", "A88018", "A88020", "A88022", "A88023", "A88025", "A88601", "A88603", "A88608", "A88611", "A88613", "A88614", "A88616", "A89001", "A89002", "A89003", "A89004", "A89005", "A89006", "A89007", "A89008", "A89009", "A89010", "A89011", "A89012", "A89013", "A89014", "A89015", "A89016", "A89017", "A89018", "A89019", "A89020", "A89021", "A89022", "A89023", "A89024", "A89025", "A89026", "A89027", "A89028", "A89029", "A89030", "A89031", "A89032", "A89034", "A89035", "A89036", "A89038", "A89040", "A89041", "A89042", "A89603", "A89604", "A89610", "A89611", "A89612", "A89614", "A89616", "A89617", "A89620", "A89621", "A89623", "A89624", "A89630", "A91023", "A91024", "A91168", "A91180", "A91181", "A91182", "A91192", "A91193", "A91299", "A91346", "A91580", "AD2000", "B81001", "B81002", "B81003", "B81004", "B81005", "B81006", "B81007", "B81008", "B81009", "B81010", "B81011", "B81012", "B81013", "B81014", "B81015", "B81016", "B81017", "B81018", "B81019", "B81020", "B81021", "B81022", "B81023", "B81024", "B81025", "B81026", "B81027", "B81029", "B81030", "B81031", "B81032", "B81034", "B81035", "B81036", "B81037", "B81038", "B81039", "B81040", "B81041", "B81042", "B81043", "B81044", "B81045", "B81046", "B81047", "B81048", "B81049", "B81050", "B81051", "B81052", "B81053", "B81054", "B81055", "B81056", "B81057", "B81058", "B81060", "B81061", "B81062", "B81063", "B81064", "B81065", "B81066", "B81068", "B81069", "B81070", "B81072", "B81074", "B81075", "B81077", "B81080", "B81081", "B81082", "B81083", "B81084", "B81085", "B81087", "B81088", "B81089", "B81090", "B81091", "B81092", "B81094", "B81095", "B81097", "B81099", "B81100", "B81101", "B81102", "B81104", "B81108", "B81109", "B81110", "B81112", "B81113", "B81118", "B81119", "B81120", "B81121", "B81602", "B81603", "B81606", "B81609", "B81615", "B81616", "B81617", "B81618", "B81619", "B81620", "B81622", "B81624", "B81626", "B81628", "B81629", "B81630", "B81631", "B81632", "B81633", "B81634", "B81635", "B81636", "B81639", "B81642", "B81644", "B81645", "B81646", "B81647", "B81648", "B81650", "B81653", "B81655", "B81656", "B81658", "B81662", "B81663", "B81664", "B81665", "B81666", "B81668", "B81669", "B81670", "B81671", "B81674", "B81675", "B81676", "B81677", "B81679", "B81682", "B81683", "B81685", "B81686", "B81688", "B81689", "B81690", "B81691", "B81692", "B81693", "B81694", "B81695", "B81696", "B81697", "B82001", "B82002", "B82003", "B82004", "B82005", "B82006", "B82007", "B82008", "B82010", "B82011", "B82012", "B82013", "B82014", "B82016", "B82017", "B82018", "B82019", "B82020", "B82021", "B82022", "B82023", "B82024", "B82025", "B82026", "B82027", "B82028", "B82029", "B82030", "B82031", "B82032", "B82033", "B82034", "B82035", "B82036", "B82037", "B82038", "B82041", "B82042", "B82044", "B82045", "B82046", "B82047", "B82049", "B82050", "B82053", "B82054", "B82055", "B82056", "B82057", "B82059", "B82060", "B82061", "B82062", "B82063", "B82064", "B82065", "B82066", "B82067", "B82068", "B82069", "B82071", "B82072", "B82073", "B82074", "B82075", "B82076", "B82077", "B82078", "B82079", "B82080", "B82081", "B82082", "B82083", "B82086", "B82087", "B82088", "B82091", "B82092", "B82095", "B82097", "B82098", "B82099", "B82100", "B82101", "B82102", "B82103", "B82104", "B82105", "B82106", "B82606", "B82609", "B82611", "B82613", "B82614", "B82617", "B82618", "B82619", "B82620", "B82622", "B82623", "B82624", "B82627", "B82628", "B82632", "B82636", "B82637", "B82639", "B82640", "B82645", "B82646", "B82683", "B83001", "B83002", "B83003", "B83005", "B83006", "B83007", "B83008", "B83009", "B83010", "B83011", "B83012", "B83013", "B83014", "B83015", "B83016", "B83017", "B83018", "B83019", "B83020", "B83021", "B83022", "B83023", "B83025", "B83026", "B83027", "B83028", "B83029", "B83030", "B83031", "B83032", "B83033", "B83034", "B83035", "B83037", "B83038", "B83039", "B83040", "B83041", "B83042", "B83043", "B83044", "B83045", "B83049", "B83050", "B83051", "B83052", "B83054", "B83055", "B83056", "B83058", "B83061", "B83062", "B83063", "B83064", "B83066", "B83067", "B83069", "B83070", "B83071", "B83602", "B83604", "B83605", "B83611", "B83613", "B83614", "B83617", "B83620", "B83621", "B83622", "B83624", "B83626", "B83627", "B83628", "B83629", "B83630", "B83631", "B83638", "B83641", "B83642", "B83646", "B83653", "B83654", "B83657", "B83658", "B83659", "B83660", "B83661", "B83673", "B84001", "B84002", "B84003", "B84004", "B84005", "B84006", "B84007", "B84008", "B84009", "B84010", "B84011", "B84012", "B84013", "B84014", "B84016", "B84017", "B84019", "B84021", "B84610", "B84612", "B84613", "B84615", "B84618", "B84623", "B85001", "B85002", "B85004", "B85005", "B85006", "B85008", "B85009", "B85010", "B85011", "B85012", "B85014", "B85015", "B85016", "B85018", "B85019", "B85020", "B85021", "B85022", "B85023", "B85024", "B85025", "B85026", "B85027", "B85028", "B85030", "B85031", "B85032", "B85033", "B85036", "B85037", "B85038", "B85041", "B85042", "B85044", "B85048", "B85049", "B85051", "B85054", "B85055", "B85058", "B85059", "B85060", "B85061", "B85062", "B85606", "B85610", "B85611", "B85612", "B85614", "B85619", "B85620", "B85621", "B85622", "B85623", "B85634", "B85636", "B85638", "B85640", "B85641", "B85644", "B85645", "B85646", "B85650", "B85652", "B85655", "B85659", "B85660", "B86001", "B86002", "B86003", "B86004", "B86005", "B86006", "B86007", "B86008", "B86009", "B86010", "B86011", "B86012", "B86013", "B86014", "B86015", "B86016", "B86017", "B86018", "B86019", "B86020", "B86022", "B86023", "B86024", "B86025", "B86026", "B86028", "B86029", "B86030", "B86031", "B86032", "B86033", "B86034", "B86035", "B86036", "B86037", "B86038", "B86039", "B86041", "B86042", "B86043", "B86044", "B86046", "B86047", "B86048", "B86049", "B86050", "B86051", "B86052", "B86054", "B86055", "B86056", "B86057", "B86058", "B86059", "B86060", "B86061", "B86062", "B86064", "B86066", "B86067", "B86068", "B86069", "B86070", "B86071", "B86074", "B86075", "B86077", "B86081", "B86086", "B86089", "B86092", "B86093", "B86094", "B86095", "B86096", "B86100", "B86101", "B86102", "B86103", "B86104", "B86105", "B86106", "B86107", "B86108", "B86109", "B86110", "B86623", "B86625", "B86628", "B86633", "B86638", "B86642", "B86643", "B86648", "B86650", "B86651", "B86654", "B86655", "B86658", "B86666", "B86667", "B86669", "B86670", "B86672", "B86673", "B86675", "B86678", "B86682", "B86683", "B87001", "B87002", "B87003", "B87004", "B87005", "B87006", "B87007", "B87008", "B87009", "B87011", "B87012", "B87013", "B87015", "B87016", "B87017", "B87018", "B87019", "B87020", "B87021", "B87022", "B87023", "B87025", "B87026", "B87027", "B87028", "B87029", "B87030", "B87031", "B87032", "B87033", "B87036", "B87039", "B87040", "B87041", "B87042", "B87044", "B87600", "B87602", "B87604", "B87614", "C81001", "C81002", "C81003", "C81004", "C81005", "C81006", "C81007", "C81008", "C81009", "C81010", "C81012", "C81013", "C81014", "C81015", "C81016", "C81018", "C81019", "C81021", "C81023", "C81026", "C81027", "C81028", "C81029", "C81033", "C81034", "C81035", "C81036", "C81040", "C81042", "C81047", "C81051", "C81052", "C81054", "C81056", "C81060", "C81071", "C81072", "C81074", "C81075", "C81076", "C81077", "C81080", "C81081", "C81082", "C81091", "C81094", "C81095", "C81096", "C81097", "C81099", "C81106", "C81107", "C81115", "C81118", "C81604", "C81611", "C81616", "C81620", "C81626", "C81630", "C81633", "C81651", "C81678", "C82001", "C82002", "C82003", "C82005", "C82007", "C82008", "C82009", "C82010", "C82011", "C82012", "C82015", "C82016", "C82018", "C82019", "C82026", "C82029", "C82032", "C82036", "C82038", "C82040", "C82042", "C82044", "C82052", "C82058", "C82059", "C82063", "C82064", "C82066", "C82092", "C82093", "C82103", "C82121", "C82674", "C83001", "C83002", "C83004", "C83005", "C83008", "C83009", "C83011", "C83014", "C83016", "C83019", "C83030", "C83054", "C83063", "C83073", "C83078", "C83614", "C83615", "C83617", "C83637", "C83649", "C83656", "C84001", "C84002", "C84003", "C84004", "C84005", "C84008", "C84009", "C84010", "C84011", "C84012", "C84013", "C84014", "C84016", "C84017", "C84018", "C84019", "C84020", "C84021", "C84023", "C84024", "C84026", "C84029", "C84030", "C84032", "C84033", "C84034", "C84036", "C84039", "C84043", "C84045", "C84047", "C84051", "C84057", "C84059", "C84069", "C84078", "C84080", "C84087", "C84092", "C84106", "C84113", "C84120", "C84123", "C84128", "C84140", "C84150", "C84613", "C84619", "C84624", "C84628", "C84637", "C84648", "C84649", "C84655", "C84656", "C84658", "C84661", "C84675", "C84676", "C84678", "C84679", "C84710", "C85001", "C85003", "C85004", "C85005", "C85007", "C85011", "C85022", "C85033", "C85617", "C85618", "C85620", "C86001", "C86002", "C86003", "C86005", "C86006", "C86007", "C86009", "C86012", "C86023", "C86025", "C86029", "C86030", "C86614", "C86622", "C87002", "C87003", "C87004", "C87005", "C87007", "C87008", "C87013", "C87019", "C87022", "C87030", "C87604", "C87612", "C87617", "C87621", "C88005", "C88006", "C88007", "C88008", "C88009", "C88014", "C88016", "C88028", "C88032", "C88037", "C88038", "C88041", "C88043", "C88046", "C88048", "C88062", "C88073", "C88077", "C88078", "C88079", "C88080", "C88081", "C88082", "C88083", "C88084", "C88086", "C88091", "C88096", "C88652", "C88653", "C88655", "D81001", "D81002", "D81003", "D81004", "D81006", "D81007", "D81008", "D81014", "D81015", "D81016", "D81019", "D81021", "D81022", "D81023", "D81024", "D81025", "D81026", "D81029", "D81031", "D81045", "D81046", "D81047", "D81050", "D81616", "D81618", "D81625", "D81629", "D81633", "D82001", "D82002", "D82003", "D82004", "D82005", "D82006", "D82007", "D82008", "D82009", "D82010", "D82011", "D82012", "D82015", "D82016", "D82019", "D82020", "D82021", "D82026", "D82027", "D82031", "D82034", "D82040", "D82042", "D82044", "D82051", "D82053", "D82055", "D82060", "D82061", "D82062", "D82064", "D82067", "D82069", "D82070", "D82073", "D82078", "D82087", "D82088", "D82096", "D82099", "D82103", "D82104", "D82105", "D82106", "D82614", "D82620", "D82623", "D82625", "D82626", "D82632", "D82633", "D82634", "D82641", "D82643", "D83001", "D83002", "D83003", "D83004", "D83005", "D83006", "D83009", "D83010", "D83011", "D83012", "D83013", "D83026", "D83030", "D83033", "D83034", "D83036", "D83043", "D83060", "D83069", "D83071", "D83074", "D83075", "D83078", "D83081", "D83620", "E00001", "E81001", "E81002", "E81003", "E81004", "E81005", "E81006", "E81008", "E81010", "E81011", "E81016", "E81017", "E81019", "E81023", "E81026", "E81028", "E81030", "E81031", "E81037", "E81038", "E81046", "E81048", "E81049", "E81051", "E81056", "E81060", "E81061", "E81064", "E81611", "E81615", "E81627", "E81640", "E82001", "E82002", "E82004", "E82005", "E82009", "E82011", "E82012", "E82013", "E82016", "E82019", "E82020", "E82024", "E82025", "E82027", "E82028", "E82040", "E82042", "E82043", "E82045", "E82048", "E82049", "E82053", "E82055", "E82060", "E82074", "E82078", "E82083", "E82085", "E82094", "E82096", "E82097", "E82099", "E82109", "E82113", "E82117", "E82124", "E82614", "E82624", "E82641", "E82644", "E82652", "E82657", "E82662", "E83003", "E83005", "E83006", "E83007", "E83008", "E83009", "E83018", "E83027", "E83044", "E83600", "E83613", "E83654", "E84002", "E84003", "E84004", "E84005", "E84006", "E84007", "E84012", "E84013", "E84014", "E84015", "E84017", "E84025", "E84044", "E84056", "E84059", "E84064", "E84067", "E84080", "E84601", "E84627", "E84645", "E84646", "E84658", "E84695", "E84702", "E85001", "E85012", "E85013", "E85014", "E85019", "E85053", "E85059", "E85066", "E85075", "E85096", "E85109", "E85110", "E85120", "E85623", "E85650", "E85655", "E85657", "E85675", "E85681", "E85714", "E85718", "E85744", "E86001", "E86003", "E86004", "E86005", "E86006", "E86007", "E86009", "E86010", "E86011", "E86012", "E86014", "E86015", "E86016", "E86017", "E86018", "E86019", "E86020", "E86022", "E86023", "E86024", "E86026", "E86027", "E86028", "E86029", "E86030", "E86033", "E86034", "E86036", "E86038", "E86041", "E86042", "E86605", "E86609", "E86610", "E86612", "E86615", "E86616", "E86617", "E86618", "E86619", "E86620", "E86622", "E86625", "E86626", "E86632", "E86633", "E86635", "E86637", "E86638", "E86639", "E86640", "E87006", "E87008", "E87016", "E87021", "E87024", "E87048", "E87052", "E87070", "E87630", "E87637", "E87665", "E87670", "E87681", "E87711", "E87735", "E87737", "E87745", "E87746", "E87761", "F81002", "F81003", "F81004", "F81005", "F81009", "F81010", "F81011", "F81012", "F81014", "F81015", "F81016", "F81017", "F81018", "F81019", "F81020", "F81021", "F81022", "F81026", "F81027", "F81030", "F81043", "F81052", "F81065", "F81073", "F81074", "F81076", "F81079", "F81082", "F81084", "F81087", "F81088", "F81091", "F81102", "F81103", "F81110", "F81112", "F81120", "F81121", "F81133", "F81143", "F81151", "F81153", "F81183", "F81185", "F81219", "F81608", "F81633", "F81645", "F81679", "F81711", "F81721", "F81729", "F81748", "F82001", "F82002", "F82003", "F82004", "F82005", "F82011", "F82012", "F82015", "F82027", "F82028", "F82031", "F82051", "F82678", "F82680", "F83002", "F83003", "F83004", "F83005", "F83006", "F83011", "F83012", "F83015", "F83016", "F83017", "F83019", "F83020", "F83023", "F83025", "F83026", "F83036", "F83043", "F83046", "F83050", "F83058", "F83064", "F83632", "F83647", "F83675", "F84003", "F84004", "F84006", "F84008", "F84010", "F84012", "F84013", "F84015", "F84016", "F84017", "F84018", "F84032", "F84062", "F84063", "F84067", "F84087", "F84092", "F84107", "F84620", "F84682", "F84698", "F84714", "F84746", "F84747", "F85002", "F85003", "F85014", "F85020", "F85024", "F85027", "F85030", "F85045", "F85048", "F85049", "F85645", "F85663", "F85669", "F86022", "F86028", "F86032", "F86042", "F86616", "F86627", "F86629", "F86667", "F86679", "F86700", "F86712", "F86731", "G81002", "G81007", "G81009", "G81023", "G81026", "G81030", "G81035", "G81038", "G81052", "G81057", "G81065", "G81086", "G81090", "G81102", "G81611", "G81643", "G81653", "G81669", "G81698", "G82011", "G82013", "G82016", "G82017", "G82019", "G82022", "G82024", "G82026", "G82036", "G82039", "G82050", "G82051", "G82074", "G82087", "G82090", "G82095", "G82099", "G82103", "G82105", "G82110", "G82114", "G82116", "G82133", "G82143", "G82147", "G82152", "G82154", "G82160", "G82210", "G82211", "G82229", "G82230", "G82234", "G82630", "G82652", "G82684", "G82702", "G82753", "G82777", "G83002", "G83003", "G83004", "G83005", "G83006", "G83007", "G83029", "G83031", "G83055", "G83061", "G83069", "G83632", "G83674", "G83679", "G84001", "G84003", "G84004", "G84010", "G84026", "G84033", "G84602", "G85001", "G85002", "G85003", "G85004", "G85006", "G85008", "G85021", "G85041", "G85075", "G85088", "G85112", "G85123", "G85124", "G85127", "G85130", "G85132", "G85618", "G85638", "G85642", "G85651", "G85672", "G85683", "G85684", "G85711", "H81003", "H81004", "H81013", "H81020", "H81022", "H81025", "H81026", "H81030", "H81031", "H81032", "H81033", "H81035", "H81038", "H81044", "H81047", "H81052", "H81054", "H81062", "H81074", "H81078", "H81082", "H81084", "H81090", "H81094", "H81101", "H81109", "H81110", "H81118", "H81128", "H81611", "H81658", "H81663", "H81666", "H81673", "H82002", "H82005", "H82007", "H82009", "H82032", "H82033", "H82051", "H82055", "H82061", "H82063", "H82615", "H82626", "H82641", "H82643", "H83001", "H83002", "H83004", "H83005", "H83011", "H83016", "H83025", "H83608", "H83624", "H83627", "H84002", "H84005", "H84006", "H84008", "H84010", "H84011", "H84015", "H84016", "H84027", "H84033", "H84043", "H84049", "H84051", "H84055", "H84060", "H84061", "H84607", "H84609", "H84633", "H84635", "H84636", "H85003", "H85005", "H85007", "H85016", "H85018", "H85020", "H85021", "H85024", "H85028", "H85033", "H85038", "H85041", "H85048", "H85051", "H85052", "H85055", "H85061", "H85066", "H85069", "H85070", "H85076", "H85087", "H85103", "H85114", "H85633", "H85639", "H85649", "H85680", "H85686", "H85687", "J81009", "J81010", "J81017", "J81027", "J81064", "J81072", "J81074", "J81075", "J81087", "J81613", "J81626", "J81646", "J82001", "J82007", "J82015", "J82021", "J82026", "J82054", "J82059", "J82066", "J82067", "J82073", "J82075", "J82079", "J82081", "J82093", "J82131", "J82132", "J82139", "J82158", "J82184", "J82190", "J82198", "J82199", "J82215", "J82217", "J82628", "J82642", "J82670", "J83001", "J83004", "J83016", "J83028", "J83029", "J83039", "J83040", "J83042", "J83607", "J83619", "J83625", "J84016", "K81002", "K81004", "K81017", "K81022", "K81024", "K81042", "K81046", "K81047", "K81052", "K81053", "K81061", "K81063", "K81073", "K81075", "K81103", "K81633", "K81636", "K81645", "K81649", "K81668", "K82001", "K82003", "K82007", "K82009", "K82013", "K82023", "K82028", "K82029", "K82043", "K82048", "K82052", "K82056", "K82063", "K82066", "K82070", "K82076", "K82619", "K82630", "K82631", "K82637", "K83002", "K83005", "K83015", "K83025", "K83026", "K83043", "K83047", "K83056", "K83059", "K83071", "K83607", "K83610", "K83620", "K83621", "K83622", "K83625", "K84001", "K84008", "K84014", "K84031", "K84036", "K84037", "K84044", "K84049", "K84052", "K84054", "K84075", "K84079", "K84080", "K84616", "K84624", "L81002", "L81004", "L81007", "L81008", "L81009", "L81012", "L81014", "L81017", "L81018", "L81019", "L81023", "L81026", "L81032", "L81036", "L81050", "L81051", "L81052", "L81055", "L81062", "L81079", "L81082", "L81106", "L81111", "L81121", "L81125", "L81127", "L81130", "L81134", "L81632", "L81639", "L81642", "L81649", "L82012", "L82017", "L82021", "L82045", "L82054", "L82066", "L83002", "L83006", "L83013", "L83029", "L83043", "L83045", "L83050", "L83088", "L83094", "L83102", "L83105", "L83108", "L83135", "L83137", "L83629", "L83655", "L83667", "L84002", "L84013", "L84014", "L84040", "L84059", "L84068", "L84084", "L84606", "L85004", "L85016", "L85037", "L85061", "L85602", "L85608", "M81001", "M81002", "M81003", "M81004", "M81005", "M81006", "M81007", "M81009", "M81010", "M81011", "M81012", "M81013", "M81014", "M81015", "M81016", "M81017", "M81018", "M81019", "M81020", "M81025", "M81026", "M81027", "M81034", "M81043", "M81048", "M81061", "M81062", "M81067", "M81069", "M81082", "M81089", "M82002", "M82003", "M82004", "M82005", "M82006", "M82007", "M82008", "M82009", "M82026", "M82042", "M82045", "M82046", "M82056", "M82601", "M83001", "M83004", "M83005", "M83007", "M83009", "M83010", "M83011", "M83012", "M83013", "M83014", "M83016", "M83018", "M83019", "M83020", "M83021", "M83024", "M83026", "M83030", "M83031", "M83032", "M83033", "M83034", "M83042", "M83048", "M83062", "M83063", "M83103", "M83127", "M83138", "M83148", "M83616", "M83639", "M83666", "M83668", "M83697", "M84001", "M84002", "M84003", "M84004", "M84005", "M84006", "M84007", "M84008", "M84009", "M84010", "M84012", "M84013", "M84016", "M84019", "M84020", "M84022", "M84024", "M84028", "M84037", "M84040", "M84043", "M84046", "M84048", "M84051", "M84066", "M84067", "M84616", "M84624", "M84627", "M84629", "M85002", "M85005", "M85007", "M85009", "M85010", "M85011", "M85015", "M85018", "M85019", "M85020", "M85024", "M85025", "M85028", "M85031", "M85037", "M85041", "M85042", "M85043", "M85046", "M85048", "M85051", "M85053", "M85055", "M85058", "M85059", "M85060", "M85061", "M85064", "M85069", "M85076", "M85083", "M85085", "M85088", "M85098", "M85111", "M85114", "M85116", "M85123", "M85128", "M85149", "M85167", "M85176", "M85642", "M85665", "M85669", "M85676", "M85699", "M85749", "M85770", "M85778", "M85792", "M85803", "M86007", "M86017", "M86630", "M87001", "M87002", "M87003", "M87015", "M87601", "M87603", "M87617", "M88006", "M88020", "M88026", "M88035", "M89001", "M89002", "M89012", "M89020", "M89023", "M89606", "M91003", "M91004", "M91010", "M91011", "M91013", "M91019", "M91020", "M91021", "M91022", "M91024", "M91025", "M91026", "M91027", "M91611", "M91624", "M91626", "M91628", "M91643", "M92001", "M92002", "M92003", "M92004", "M92006", "M92007", "M92008", "M92009", "M92010", "M92013", "M92020", "M92028", "M92606", "M92613", "N81001", "N81002", "N81005", "N81006", "N81007", "N81008", "N81009", "N81010", "N81013", "N81015", "N81017", "N81018", "N81021", "N81024", "N81025", "N81026", "N81029", "N81034", "N81037", "N81040", "N81051", "N81052", "N81061", "N81063", "N81069", "N81080", "N81081", "N81083", "N81085", "N81091", "N81092", "N81093", "N81094", "N81095", "N81096", "N81100", "N81102", "N81125", "N81615", "N81626", "N81628", "N81649", "N81658", "N82001", "N82002", "N82003", "N82011", "N82014", "N82019", "N82024", "N82044", "N82054", "N82062", "N82065", "N82079", "N82095", "N82099", "N82103", "N82115", "N82117", "N82617", "N82623", "N82641", "N82656", "N82659", "N82660", "N82661", "N82663", "N82664", "N82665", "N82667", "N82668", "N82669", "N82670", "N82671", "N82672", "N82673", "N82674", "N82675", "N82676", "N82677", "N82678", "N83003", "N83005", "N83006", "N83007", "N83009", "N83012", "N83013", "N83014", "N83015", "N83018", "N83032", "N83035", "N83057", "N84001", "N84002", "N84003", "N84004", "N84005", "N84006", "N84007", "N84008", "N84009", "N84012", "N84013", "N84015", "N84021", "N84036", "N84625", "N85004", "N85027", "N85040", "N85053", "N85058", "P81002", "P81003", "P81006", "P81010", "P81014", "P81015", "P81016", "P81017", "P81020", "P81022", "P81027", "P81033", "P81037", "P81038", "P81040", "P81042", "P81046", "P81051", "P81054", "P81055", "P81066", "P81083", "P81084", "P81143", "P81160", "P81184", "P81191", "P81204", "P81668", "P81687", "P81707", "P81710", "P81713", "P81714", "P81738", "P81769", "P82001", "P82002", "P82003", "P82005", "P82007", "P82009", "P82010", "P82011", "P82012", "P82014", "P82029", "P82607", "P82617", "P82626", "P83001", "P83003", "P83005", "P83007", "P83008", "P83009", "P83012", "P83013", "P83017", "P83019", "P83021", "P83023", "P83030", "P83621", "P83625", "P84004", "P84005", "P84009", "P84010", "P84011", "P84012", "P84016", "P84017", "P84019", "P84020", "P84023", "P84024", "P84025", "P84026", "P84027", "P84028", "P84030", "P84032", "P84033", "P84037", "P84038", "P84039", "P84040", "P84041", "P84048", "P84053", "P84054", "P84064", "P84626", "P84633", "P84689", "P85002", "P85004", "P85006", "P85611", "P85613", "P86002", "P86004", "P86006", "P86010", "P86021", "P86624", "P87002", "P87003", "P87008", "P87015", "P87016", "P87020", "P87026", "P87039", "P87609", "P87612", "P87625", "P87626", "P87630", "P87641", "P87642", "P87657", "P87668", "P88001", "P88002", "P88003", "P88026", "P88034", "P88625", "P88635", "P89002", "P89006", "P89010", "P91003", "P91004", "P91007", "P91014", "P91027", "P91028", "P91609", "P92001", "P92003", "P92005", "P92012", "P92017", "P92030", "P92031", "P92033", "P92630", "P92652", "S16047", "S16136", "S16206", "S16579", "V02700", "V81997", "V81998", "V81999", "W00000", "W00001", "W00002", "W00003", "W00005", "W00006", "W00007", "W00011", "W91016", "W91042", "W91046", "W91050", "W92008", "W92021", "W92034", "W92042", "W92044", "W92053", "W93001", "W93007", "W93019", "W93020", "W93021", "W93038", "W93046", "W94011", "W94025", "W94034", "W94037", "W94612", "W95010", "W95014", "W95041", "W95080", "W95089", "W95623", "W95634", "W96009", "W96013", "W97003", "W97005", "W97008", "W97016", "W97017", "W97020", "W97021", "W97023", "W97024", "W97025", "W97033", "W97036", "W97041", "W97053", "W97060", "W97061", "W97067", "W97068", "W97069", "W97286", "W97291", "W97294", "W97616", "W99010", "W99025", "XCDF56", "Y00001", "Y00002", "Y00003", "Y00004", "Y00005", "Y00006", "Y00007", "Y00008", "Y00009", "Y00010", "Y00011", "Y00012", "Y00013", "Y00014", "Y00017", "Y00025", "Y00030", "Y00038", "Y00039", "Y00042", "Y00062", "Y00088", "Y00098", "Y00133", "Y00145", "Y00167", "Y00172", "Y00208", "Y00211", "Y00212", "Y00213", "Y00214", "Y00215", "Y00216", "Y00217", "Y00218", "Y00219", "Y00220", "Y00221", "Y00222", "Y00223", "Y00241", "Y00242", "Y00243", "Y00253", "Y00254", "Y00255", "Y00259", "Y00261", "Y00264", "Y00265", "Y00267", "Y00274", "Y00275", "Y00282", "Y00284", "Y00286", "Y00290", "Y00291", "Y00292", "Y00293", "Y00294", "Y00295", "Y00296", "Y00299", "Y00300", "Y00304", "Y00306", "Y00307", "Y00313", "Y00319", "Y00328", "Y00334", "Y00342", "Y00352", "Y00356", "Y00357", "Y00358", "Y00363", "Y00364", "Y00369", "Y00381", "Y00396", "Y00399", "Y00400", "Y00406", "Y00408", "Y00418", "Y00432", "Y00437", "Y00440", "Y00452", "Y00483", "Y00500", "Y00502", "Y00514", "Y00522", "Y00527", "Y00542", "Y00546", "Y00560", "Y00561", "Y00565", "Y00583", "Y00627", "Y00630", "Y00633", "Y00647", "Y00650", "Y00667", "Y00705", "Y00712", "Y00744", "Y00756", "Y00757", "Y00779", "Y00780", "Y00788", "Y00800", "Y00836", "Y00853", "Y00883", "Y00897", "Y00944", "Y00955", "Y00994", "Y00999", "Y01016", "Y01055", "Y01056", "Y01058", "Y01059", "Y01082", "Y01110", "Y01122", "Y01139", "Y01152", "Y01153", "Y01179", "Y01207", "Y01227", "Y01245", "Y01257", "Y01280", "Y01291", "Y01636", "Y01637", "Y01695", "Y01734", "Y01860", "Y01895", "Y01920", "Y01948", "Y01949", "Y01995", "Y02002", "Y02043", "Y02055", "Y02075", "Y02091", "Y02101", "Y02139", "Y02173", "Y02174", "Y02175", "Y02176", "Y02177", "Y02178", "Y02179", "Y02180", "Y02181", "Y02182", "Y02183", "Y02184", "Y02185", "Y02186", "Y02187", "Y02188", "Y02189", "Y02190", "Y02504", "Y02926", "Y03108", "Y03580", "Y03749", "Y04573", "Y05010", "Y05366", "Y05496", "Y05512", "Y06468", "Y06469", "Y40001", "Y40003", "Y90002", "Y90003", "Y90004", "Y90005", "Y90006", "Y90009", "Y90012", "Y90013", "Y90014", "Y90015", "Y90016", "Y90017", "Y90018", "Y90019", "Y90020", "Y90021", "Y90022", "Y90023", "Y90024", "Y90025", "Y90026", "Y90027", "Y90028", "Y90029", "Y90030", "Y90031", "Y90032", "Y90033", "Y90034", "Y90035", "Y90036", "Y90037", "Y90038", "Y90039", "Y90040", "Y90041", "Y90042", "Y90043", "Y90044", "Y90045", "Y90046", "Y90047", "Y90048", "Y90049", "Y90050", "Y90051", "Y90052", "Y90053", "Y90054", "Y90055", "Y90056", "Y90057", "Y90058", "Y90059", "Y90060", "Y90061", "Y90062", "Y90063", "Y90064", "Y90065", "Y90066", "Y90067", "Y90068", "Y90069", "Y90070", "Y90071", "Y90072", "Y90073", "Y90074", "Y90075", "Y90076", "Y90077", "Y90078", "Y90079", "Y90080", "Y90081", "Y90082", "Y90083", "Y90084", "Y90085", "Y90086", "Y90087", "Y90088", "Y90089", "Y90090", "Y90091", "Y90092", "Y90093", "Y90094", "Y90095", "Y90096", "Y90097", "Y90098", "Y90099", "Y90100", "Y90101", "Y90102", "Y90103", "Y90104", "Y90105", "Y90106", "Y90107", "Y90108", "Y90109", "Y90110", "Y90111", "Y90112", "Y90129", "Y90181", "Y90203", "Y90206", "Y90207", "Y90208", "Y90216", "Y90217", "Y90218", "Y90219", "Y90220", "Y90221", "Y90222", "Y90223", "Y90224", "Y90225", "Y90226", "Y90227", "Y90228", "Y90229", "Y90230", "Y90231", "Y90232", "Y90233", "Y90234", "Y90235", "Y90236", "Y90237", "Y90239", "Y90242", "Y90243", "Y90244", "Y90245", "Y90246", "Y90247", "Y90248", "Y90249", "Y90250", "Y90251", "Y90252", "Y90253", "Y90254", "Y90255", "Y90256", "Y90257", "Y90258", "Y90259", "Y90260", "Y90261", "Y90262", "Y90263", "Y90264", "Y90265", "Y90266", "Y90267", "Y90270", "Y90271", "Y90272", "Y90273", "Y90274", "Y90275", "Y90276", "Y90277", "Y90278", "Y90279", "Y90280", "Y90281", "Y90282", "Y90283", "Y90284", "Y90285", "Y90286", "Y90287", "Y90288", "Y90289", "Y90290", "Y90291", "Y90292", "Y90293", "Y90294", "Y90295", "Y90296", "Y90297", "Y90298", "Y90299", "Y90300", "Y90301", "Y90302", "Y90303", "Y90304", "Y90305", "Y90306", "Y90307", "Y90308", "Y90309", "Y90310", "Y90311", "Y90312", "Y90313", "Y90314", "Y90315", "Y90316", "Y90317", "Y90318", "Y90319", "Y90321", "Z00001", ]
# Copyright 2008 Canonical Ltd. # This file is part of lazr.restfulclient. # # lazr.restfulclient is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # lazr.restfulclient is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with lazr.restfulclient. If not, see # <http://www.gnu.org/licenses/>. """lazr.restfulclient errors.""" __metaclass__ = type __all__ = [ 'BadRequest', 'Conflict', 'ClientError', 'CredentialsError', 'CredentialsFileError', 'HTTPError', 'MethodNotAllowed', 'NotFound', 'PreconditionFailed', 'RestfulError', 'ResponseError', 'ServerError', 'Unauthorized', 'UnexpectedResponseError', ] class RestfulError(Exception): """Base error for the lazr.restfulclient API library.""" class CredentialsError(RestfulError): """Base credentials/authentication error.""" class CredentialsFileError(CredentialsError): """Error in credentials file.""" class ResponseError(RestfulError): """Error in response.""" def __init__(self, response, content): RestfulError.__init__(self) self.response = response self.content = content class UnexpectedResponseError(ResponseError): """An unexpected response was received.""" def __str__(self): return '%s: %s' % (self.response.status, self.response.reason) class HTTPError(ResponseError): """An HTTP non-2xx response code was received.""" def __str__(self): """Show the error code, response headers, and response body.""" headers = "\n".join(["%s: %s" % pair for pair in sorted(self.response.items())]) return ("HTTP Error %s: %s\n" "Response headers:\n---\n%s\n---\n" "Response body:\n---\n%s\n---\n") % ( self.response.status, self.response.reason, headers, self.content) class ClientError(HTTPError): """An exception representing a client-side error.""" class Unauthorized(ClientError): """An exception representing an authentication failure.""" class NotFound(ClientError): """An exception representing a nonexistent resource.""" class MethodNotAllowed(ClientError): """An exception raised when you use an unsupported HTTP method. This is most likely because you tried to delete a resource that can't be deleted. """ class BadRequest(ClientError): """An exception representing a problem with a client request.""" class Conflict(ClientError): """An exception representing a conflict with another client.""" class PreconditionFailed(ClientError): """An exception representing the failure of a conditional PUT/PATCH. The most likely explanation is that another client changed this object while you were working on it, and your version of the object is now out of date. """ class ServerError(HTTPError): """An exception representing a server-side error.""" def error_for(response, content): """Turn an HTTP response into an HTTPError subclass. :return: None if the response code is 1xx, 2xx or 3xx. Otherwise, an instance of an appropriate HTTPError subclass (or HTTPError if nothing else is appropriate. """ http_errors_by_status_code = { 400 : BadRequest, 401 : Unauthorized, 404 : NotFound, 405 : MethodNotAllowed, 409 : Conflict, 412 : PreconditionFailed, } if response.status // 100 <= 3: # 1xx, 2xx and 3xx are not considered errors. return None else: cls = http_errors_by_status_code.get(response.status, HTTPError) if cls is HTTPError: if response.status // 100 == 5: cls = ServerError elif response.status // 100 == 4: cls = ClientError return cls(response, content)
ROBOT_POSITION_RESSOURCE = '/robotposition' CUBE_POSITION_RESSOURCE = '/cubeposition' PATH_RESSOURCE = '/path' FLAG_RESSOURCE = '/flag'
server = "uri.pi" port = 4711 # well World home = Vec3(-66.9487,7.0,-39.5313)
def Black_mesa(thoughts, eyes, eye, tongue): return f""" {thoughts} {thoughts} .-;+\$XHHHHHHX\$+;-. ,;X\@\@X%/;=----=:/%X\@\@X/, =\$\@\@%=. .=+H\@X: -XMX: =XMX= /\@\@: =H\@+ %\@X, .\$\@\$ +\@X. \$\@% -\@\@, .\@\@= %\@% +\@\$ H\@: :\@H H\@: :HHHHHHHHHHHHHHHHHHX, =\@H %\@% ;\@M\@\@\@\@\@\@\@\@\@\@\@\@\@\@\@\@\@H- +\@\$ =\@\@, :\@\@\@\@\@\@\@\@\@\@\@\@\@\@\@\@\@\@\@\@\@= .\@\@: +\@X :\@\@\@\@\@\@\@\@\@\@\@\@\@\@\@M\@\@\@\@\@\@:%\@% \$\@\$, ;\@\@\@\@\@\@\@\@\@\@\@\@\@\@\@\@\@M\@\@\@\@\@\@\$. +\@\@HHHHHHH\@\@\@\@\@\@\@\@\@\@\@\@\@\@\@\@\@\@\@\@\@\@\@+ =X\@\@\@\@\@\@\@\@\@\@\@\@\@\@\@\@\@\@\@\@\@\@\@\@\@\@\@\@X= :\$\@\@\@\@\@\@\@\@\@\@\@\@\@\@\@\@\@\@\@M\@\@\@\@\$: ,;\$\@\@\@\@\@\@\@\@\@\@\@\@\@\@\@\@\@\@X/- .-;+\$XXHHHHHX\$+;-. """
# file handling # 1) without using with statement file = open('t1.txt', 'w') file.write('hello world !') file.close() # 2) without using with statement file = open('t2.txt', 'w') try: file.write('hello world') finally: file.close() # 3) using with statement with open('t3.txt', 'w') as file: file.write('hello world !')
""" Sentinel module to signify that a parameter should use its default value. Useful when the default value or ``None`` are both valid options. """
""" Desempacotamento de listas em python """ lista = ['Luiz', 'João', 'Maria', 1, 2, 3, 4, 5] n1, n2, *n3 = lista #todo: usando a * cria outra lista, e os valores que eu quiser mostrar, começa pelas ultimas print(n3)
#Will add a fixed header and return a sendable string (we should add pickle support here at some point somehow), also encodes the message for you def createMsg(data): msg = data msg = f'{len(msg):<10}' + msg return msg.encode("utf-8") #streams data from the 'target' socket with an initial buffersize of 'bufferSize' (returns the decoded data) def streamData(target, bufferSize): #initial data chunk (contains an int of how much data the server should expect) data = target.recv(bufferSize) msglen = int(data[:bufferSize].strip()) decoded_data = '' #stream the data in with a set buffer size while len(decoded_data) < msglen: print(decoded_data) decoded_data += target.recv(bufferSize).decode("utf-8") return decoded_data
class Solution: def maxNonOverlapping(self, nums: List[int], target: int) -> int: last = {0:-1} s = 0 dp = [0]*len(nums) for i in range(len(nums)): s += nums[i] if s-target in last: dp[i] = max(dp[i-1] if i-1>=0 else 0, 1+ (dp[last[s-target]] if last[s-target]>=0 else 0)) else: dp[i] = dp[i-1] if i-1>=0 else 0 last[s] = i return dp[-1]
def ascii_cipher(message, key): pfactor = max( i for i in range(2, abs(key)+1) if is_prime(i) and key%i==0 )*(-1 if key<0 else 1) return ''.join(chr((ord(c)+pfactor)%128) for c in message) def is_prime(n): if n < 2: return False return all( n%i!=0 for i in range(2, round(pow(n,0.5))+1) ) or n==2
#!/usr/bin/env python # -*- coding: utf-8 -*- """ __project__ = 'leetcode' __file__ = '__init__.py' __author__ = 'king' __time__ = '2020/2/10 14:40' _ooOoo_ o8888888o 88" . "88 (| -_- |) O\ = /O ____/`---'\____ .' \\| |// `. / \\||| : |||// \ / _||||| -:- |||||- \ | | \\\ - /// | | | \_| ''\---/'' | | \ .-\__ `-` ___/-. / ___`. .' /--.--\ `. . __ ."" '< `.___\_<|>_/___.' >'"". | | : `- \`.;`\ _ /`;.`/ - ` : | | \ \ `-. \_ __\ /__ _/ .-` / / ======`-.____`-.___\_____/___.-`____.-'====== `=---=' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 佛祖保佑 永无BUG """ """ 难度:困难 给定两个大小为 m 和 n 的有序数组nums1 和nums2。 请你找出这两个有序数组的中位数,并且要求算法的时间复杂度为O(log(m + n))。 你可以假设nums1和nums2不会同时为空。 示例 1: nums1 = [1, 3] nums2 = [2] 则中位数是 2.0 示例 2: nums1 = [1, 2] nums2 = [3, 4] 则中位数是 (2 + 3)/2 = 2.5 """ class Solution(object): def findMedianSortedArrays(self, nums1, nums2): """ :type nums1: List[int] :type nums2: List[int] :rtype: float """ def get_kth_smallest(a_start, b_start, k): if k <= 0 or k > len(nums1) - a_start + len(nums2) - b_start: raise ValueError('k is out of the bounds of the input lists') if a_start >= len(nums1): return nums2[b_start + k - 1] if b_start >= len(nums2): return nums1[a_start + k - 1] if k == 1: return min(nums1[a_start], nums2[b_start]) mid_A = float('inf') mid_B = float('inf') if k // 2 - 1 < len(nums1) - a_start: mid_A = nums1[a_start + k // 2 - 1] if k // 2 - 1 < len(nums2) - b_start: mid_B = nums2[b_start + k // 2 - 1] if mid_A < mid_B: return get_kth_smallest(a_start + k // 2, b_start, k - k // 2) return get_kth_smallest(a_start, b_start + k // 2, k - k // 2) right = get_kth_smallest(0, 0, 1 + (len(nums1) + len(nums2)) // 2) if (len(nums1) + len(nums2)) % 2 == 1: return right left = get_kth_smallest(0, 0, (len(nums1) + len(nums2)) // 2) return (left + right) / 2.0 print(Solution().findMedianSortedArrays([1, 2], [3, 4]))
class Solution: """ @param heights: a matrix of integers @return: an integer """ def trapRainWater(self, heights): """ :type heightMap: List[List[int]] :rtype: int """ m = len(heights) n = len(heights[0]) if m else 0 peakMap = [[0x7FFFFFFF] * n for _ in range(m)] q = [] for x in range(m): for y in range(n): if x in (0, m - 1) or y in (0, n - 1): peakMap[x][y] = heights[x][y] q.append((x, y)) while q: x, y = q.pop(0) for dx, dy in zip((1, 0, -1, 0), (0, 1, 0, -1)): nx, ny = x + dx, y + dy if nx <= 0 or nx >= m - 1 or ny <= 0 or ny >= n - 1: continue limit = max(peakMap[x][y], heights[nx][ny]) if peakMap[nx][ny] > limit: peakMap[nx][ny] = limit q.append((nx, ny)) return sum(peakMap[x][y] - heights[x][y] for x in range(m) for y in range(n)) # class Solution: # """ # @param heights: a matrix of integers # @return: an integer # """ # def trapRainWater(self, heights): # result = 0 # height_dict = dict() # for i, rows in enumerate(heights): # for j, height in enumerate(rows): # if height in height_dict: # height_dict[height].append((i,j)) # else: # height_dict[height] = [(i,j)] # height_dict = sorted(height_dict.items(), key=lambda d:d[0]) # while len(height_dict) > 1: # height_positions = height_dict.pop(0) # cur_height = height_positions[0] # positions = height_positions[1] # step = height_dict[0][0] - cur_height # while positions: # position = positions[0] # area = [0] # valid = [True] # self.dfs(position[0], position[1], cur_height, heights, valid, area, step, positions, height_dict) # if valid[0]: # result += area[0] * step # return result # def dfs(self, i, j, cur_height, heights, valid, area, step, positions, height_dict): # if not positions: # return # if (i, j) not in positions: # return # if i == 0 or i == len(heights) - 1 or j == 0 or j == len(heights[0]) - 1: # valid[0] = False # height_dict[0][1].append((i,j)) # positions.remove((i,j)) # area[0] += 1 # self.dfs(i + 1, j, cur_height, heights, valid, area, step, positions, height_dict) # self.dfs(i - 1, j, cur_height, heights, valid, area, step, positions, height_dict) # self.dfs(i, j + 1, cur_height, heights, valid, area, step, positions, height_dict) # self.dfs(i, j - 1, cur_height, heights, valid, area, step, positions, height_dict)
def add_two(a, b): '''Adds two numbers together''' return a + b def multiply_two(a, b): '''Multiplies two numbers together''' return a * b
# -*- coding:utf8 -*- """ @Author: Zhirui(Alex) Yang @Date: 2021/4/25 下午11:07 """
# # example string # string = 'cat' # width = 5 # print right justified string # print(string.rjust(width)) # print(string.rjust(width)) # # example string # string = 'cat' # width = 5 # fillchar = '*' # # print right justified string # print(string.rjust(width, fillchar)) # # .centre function # string = "Python is awesome" # new_string = string.center(24) # print(string.center(24)) # print("Centered String: ", new_string) # print(new_string) # s = input() # list1 = [word.capitalize() for word in s.split(' ')] # a = ' '.join(list1) # print(a) # print(list1) size = 5 a = list(map(chr, range(97, 122))) m = a[size-1::-1] + a[:size] print(m)
turno = input('M-matutino, V-vespertino, N-noturno: ') if (turno == 'M')or(turno == 'm') : print ('Bom Dia') if (turno == 'V')or(turno == 'v'): print ('Boa Tarde') if (turno == 'N')or(turno == 'n'): print ('Boa Noite') else: print ('Valor inválido')
""" In a binary tree, the root node is at depth 0, and children of each depth k node are at depth k+1. Two nodes of a binary tree are cousins if they have the same depth, but have different parents. We are given the root of a binary tree with unique values, and the values x and y of two different nodes in the tree. Return true if and only if the nodes corresponding to the values x and y are cousins. Example 1: Input: root = [1,2,3,4], x = 4, y = 3 Output: false Example 2: Input: root = [1,2,3,null,4,null,5], x = 5, y = 4 Output: true Example 3: Input: root = [1,2,3,null,4], x = 2, y = 3 Output: false Note: The number of nodes in the tree will be between 2 and 100. Each node has a unique integer value from 1 to 100. """ # Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self.right = right class Solution: def isCousins(self, root: TreeNode, x: int, y: int) -> bool: def check(node, mom, x, level): if not node: return if node.val == x: print (mom, level) return [mom, level] return check(node.left, node, x, level+1) or check(node.right, node, x, level+1) i = check(root, None, x, 0) j = check(root, None, y, 0) if i[0] != j[0] and i[1]==j[1]: return True return False
def test_use_provider(accounts, networks): with networks.fantom.local.use_provider("test"): account = accounts.test_accounts[0] account.transfer(account, 100)
class Field(object): def render(self, field): raise NotImplementedError('Field.render needs to be defined') class Attr(Field): def __init__(self, attr, default=None, type=None): self.attr = attr self.default = default if type is None: self.type = lambda x: x else: self.type = type def render(self, field): try: x = field for attr in self.attr.split('.'): x = getattr(x, attr) return self.type(x) except AttributeError: return self.default class Name(Field): def render(self, field): return field.__name__.replace('__', '.') class Func(Field): def __init__(self, func): self.func = func def render(self, field): return self.func(field) class Literal(Field): def __init__(self, value): self.value = value def render(self, *args, **kwargs): return self.value
# 给定一个单词列表,我们将这个列表编码成一个索引字符串 S 与一个索引列表 A。 # 例如,如果这个列表是 ["time", "me", "bell"],我们就可以将其表示为 S = "time#bell#" 和 indexes = [0, 2, 5]。 # 对于每一个索引,我们可以通过从字符串 S 中索引的位置开始读取字符串,直到 "#" 结束,来恢复我们之前的单词列表。 # 那么成功对给定单词列表进行编码的最小字符串长度是多少呢? #   # 示例: # 输入: words = ["time", "me", "bell"] # 输出: 10 # 说明: S = "time#bell#" , indexes = [0, 2, 5] 。 #   # 提示: # 1 <= words.length <= 2000 # 1 <= words[i].length <= 7 # 每个单词都是小写字母 。 # 来源:力扣(LeetCode) # 链接:https://leetcode-cn.com/problems/short-encoding-of-words # 著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。 # 先去重 # 循环删除所有可能存在的是别的字符串后缀的单独字符串 class Solution: def minimumLengthEncoding(self, words): good = set(words) for word in words: for k in range(1, len(word)): good.discard(word[k:]) return sum(len(word) + 1 for word in good) class Solution1: def minimumLengthEncoding(self, words) -> int: rev = 0 words = list(set(words)) lw = len(words) if lw == 0: return 0 words.sort(key=lambda x: len(x), reverse=True) temp = [words.pop()] now = 0 while words: for word in words: if temp[now].endswith(word): words.remove(word) if not words: break temp.append(words.pop()) now += 1 return sum([len(word)+1 for word in temp]) if __name__ == "__main__": s = Solution() s.minimumLengthEncoding(["time", "me", "bell", "ime", "me"]) temp = [ "mokgggq", "pjdislx", "bfrbsfs", "hgwqzz", "bnwxc", "pzhmyo", "wbfton", "evdro", "uwxuzmn", "mdwfn", "rinmw", "cwvvrea", "aqyxlev", "ipypqev", "cbdhb", "ynqok", "lieciy", "sqhmdh", "pcotcq", "vyeqmey", "gvpbu", "kvhaag", "qkaqq", "mwtmzzs", "gtywt", "cnowp", "ibfdgvp", "jybmx", "gseqh", "yaohcp", "jgarzaz", "lgxogb", "cjjiev", "tjfbf", "qwtlx", "hehmv", "oergh", "ovehsf", "zifrfb", "tbykq", "oasqrsw", "hjmzil", "fuylmzc", "zokxci", "wbyspc", "cqwsb", "oftqr", "wvgtmrq", "ymfyjm", "odrnphc", "mnoms", "frhelt", "gokypg", "yoafppu", "mmquko", "klnvy", "atcfwzv", "yjmluf", "hckdblw", "wreortt", "osuidhr", "vmvopqa", "snilp", "lpygwbe", "esqpirj", "lacnfr", "dnyehuz", "qfvuo", "jvnlky", "gdnzemt", "isewa", "hvmfts", "nuxsog", "cckcw", "bmxtsb", "ozlilc", "wmhku", "uhoni", "ckkbb", "uwrakdx", "kciqov", "xrpjq", "lqvbs", "fyrglkp", "xfbgq", "vrojsdw", "wwivh", "frgontv", "fgghrms", "psxdbxb", "ezapa", "lvihja", "oydcdih", "ztefj", "khpoypx", "llwgyuq", "heepqf", "lneold", "lxcyjrt", "yrnzmvm", "kwcluhu", "qoqbzzu", "cuwmp", "qiejx", "fnqceo", "myizd", "thggnqx", "ixwbbve", "gjwruu", "alpglnk", "zrhmh", "evkojps", "gvwol", "pystdn", "yhcjrd", "qtyhucx", "cwmbh", "vrlmw", "bwkntib", "isyyx", "bptejfp", "gctufb", "lewtr", "llkwsi", "rokvhw", "jwagu", "axchu", "llshkne", "lnrwco", "ylnkjsu", "ukdaxm", "byfnel", "deecwis", "xwjjf", "xwsyfi", "bvnen", "supbi", "dzara", "qtnyslh", "zflzqu", "rfbsz", "yiwbok", "kpvpmey", "aosdked", "gjogz", "pwaww", "qpqhoz", "avlxwv", "aakku", "ykpjq", "biejhfz", "ngnmk", "gucufvo", "zonyhu", "pwbnko", "dianhi", "svdulhs", "seaqz", "tupyev", "rfsde", "qgvwnz", "ijjpsx", "vwwizu", "cegwsql", "snsrb", "kzarfp", "xsvwq", "zdend", "hnnib", "ghtfd", "pgdlfx", "iyrfnl", "xhnpif", "axinxpx", "cttjnl", "gmkji", "ewbecn", "fqpvci", "iazmng", "ehfmc", "wsmjtm", "vsxto", "cguyk", "mncgl", "brafj", "jvpivd", "ljburu", "pgxbvd", "ewxxx", "trmshp", "spfdgn", "oczwdxj", "wvnared", "ktzmiu", "kdqww", "saeuudb", "mwzel", "sbihma", "jemgzpm", "oogsc", "lvhtgm", "thuis", "ljkdo", "ewgvbu", "emuxgt", "kgxyfdi", "tzwmlof", "canbgua", "nwqeqwg", "ikmorv", "uzanjn", "npmjwyl", "hwkdfld", "bbmil", "kgfro", "qamev", "nuvhoh", "pklbp", "yzfplx", "bcifen", "gimid", "xiiqj", "pvvcocj", "skshvmq", "nlhsqt", "zqttm", "xuskbm", "jejdbjq", "xecjgs", "udenjcp", "tsrekhp", "iisxmwb", "gmtovot", "kqcfsdo", "efpsvqi", "ylhxyv", "tvamwgp", "kidlop", "amwsk", "xeplp", "tkuhek", "qaweb", "orrzhb", "ogiylt", "muvbpg", "ooiebj", "gtkqk", "uurhse", "cmwmgh", "yiaogkj", "famrlgt", "nslern", "hsdfss", "asujt", "hbdmg", "qokzr", "razeq", "vwfrnu", "hbgkrf", "betedj", "wctub", "dpfrrv", "zengra", "elphsd", "lkvhwx", "xutmp", "huqpltl", "qaatefx", "zarfa", "dliudeh", "ggniy", "cvarq", "rjjkqs", "xkzztf", "vjmoxa", "cigku", "cvmlpfj", "vxmmb", "kqxfn", "nuwohcs", "sezwzhd", "xpglr", "ypmuob", "flqmt", "ergssgv", "ourdw", "sexon", "kwhdu", "vdhdes", "inellc", "urjhgcj", "vipnsis", "rwtfs", "nrahj", "jnnxk", "emesdw", "iyiqq", "luuadax", "ueyurq", "vzbcshx", "flywfhd", "kphagyo", "tygzn", "alauzs", "oupnjbr", "rpqsl", "xpqbqkg", "tusht", "llxhgx", "bdmhnbz", "kwzxtaa", "mhtoir", "heyanop", "bvjrov", "udznmet", "kxrdmr", "vmldb", "qtriy", "qfmbt", "ppxgclr", "jywhzz", "rdntkwp", "hlejhf", "pvqjag", "zcnudmz", "wcyuaqz", "tudmp", "kluqos", "slygy", "zkixjqg", "socvj", "igvxwq", "oyugfh", "jscjg", "qmigl", "yazwe", "shzapa", "zqgmc", "rmfrfz", "tdgquiz", "ducbvxz", "uiddcnw", "aapdunz", "bagnif", "dbjyal", "qgbram", "bivve", "vxrtcs", "szwigrl", "zmuteys", "zagudtp", "lrjmobu", "ozbgh", "hvoxaw", "xmjna", "lqlkqqq", "oclufg", "ovbokv", "oezekn", "hcfgcen", "aablpvt", "ejvzn", "tzncr", "lhedw", "wiqgdb", "gctgu", "zczgt", "vufnci", "jlwsm", "dcrqe", "ghuev", "exqdhff", "kvecua", "relofjm", "jjznnjd", "imbklr", "sjusb", "tqhvlej", "jcczqnz", "vyfzx", "audyo", "ckysmmi", "oanjmb", "fhtnb", "rzqagl", "wxlxmj", "nyfel", "wruftl", "uuhbsje", "oobjkmy", "litiwj", "dxscotz", "znvixpd", "nsxso", "ieati", "iaodgc", "dgyvzr", "rvfccm", "cchxt", "raiqi", "owzwnr", "rkosimq", "dyrscbo", "ppjtey", "ebnuom", "bifrbq", "teclf", "ztbbyr", "omrehv", "wtrvc", "dllgjc", "guxeicj", "udmxbe", "zrvravk", "dnric", "sbnxmxv", "ckzah", "qzbrlq", "gtmjvoq", "xarml", "jeqco", "hnodvno", "fomdpk", "coqoudc", "eochkh", "hdghbb", "jiiyrvp", "vsdydi", "owctgdz", "hqafd", "zhjktay", "yqcfv", "ajququ", "gftptr", "amllxns", "sisfbef", "tdjwhz", "wrvkr", "hqxuo", "bhrjk", "igjldkr", "ujqwaj", "ufksq", "kmfai", "zsjiot", "civroa", "eqpoiu", "hjpnw", "snxdde", "vxkro", "lvyddk", "rfskh", "zcnjtk", "hsszo", "uxnnj", "yghbnl", "cunqr", "pkbwwy", "ozjxbzt", "sxqxmz", "arkjqwp", "buwcygp", "eqthat", "lqrofq", "wwfmh", "xjddhyu", "nluzkk", "sofgqaw", "yrwhfg", "pkhiq", "kpupg", "eonip", "ptkfqlu", "togolji", "exrnx", "keofq", "jltdju", "jcnjdjo", "qbrzz", "znymyrb", "cjjma", "dqyhp", "tcmmlpj", "qictc", "jgswqyq", "jcrib", "myajs", "dsqicw", "llszo", "kxjsos", "xxstde", "vavnq", "rjelsx", "lermaxm", "gqaaeu", "neovumn", "azaeg", "lztlxhi", "pqbaj", "wjujyo", "hldxxb", "ocklr", "lgvnou", "egjrf", "scigsem", "orrjki", "ncugkks", "dfpui", "zbmwda", "gqlxi", "xawccav", "rtels", "bewrq", "xvhkn", "pyzdzju", "voizx", "cxuxll", "kyyyg", "qdngpff", "dvtivnb", "lsurzr", "xyxcev", "ojbhjhu", "qxenhl", "lgzcsib", "xwomf", "yevuml", "anfpjp", "hsqxxna", "wknpn", "hpeffdv", "yjqvvyz", "eoctiv", "wannxu", "slxnf", "ijadma", "uaxypn", "xafpljk", "nysxmyv", "nfhvjfd", "nykvxrp", "nvpvf", "dxupo", "pvyqjdx", "wyzudq", "vgwpkyj", "qlhbvp", "hvhpmh", "djwukq", "rdnmazf", "gnnryn", "mllysxq", "iapvpe", "zcpayi", "amuakk", "slwgc", "pbqffyw", "emlurpa", "kecswbq", "pfbzg", "opjexe", "savxot", "finntqj", "tnzroga", "jktlrsn", "beyir", "txsvlt", "qjkbxr", "qomtajo", "ytvkqbz", "dxantfq", "zsstb", "sonmv", "rxplgr", "ltmnnl", "najvi", "ucdrotu", "smeccv", "iqyssw", "ytkgn", "ccrzv", "iepvgw", "zbnyyh", "mupzq", "ztghi", "ztyaen", "efnzco", "ugsyq", "puokxgl", "ceqotz", "yytwzik", "gxsbdne", "vgcjgyu", "sfidsno", "cqkvw", "rscfgmv", "zpoblc", "oslpwhv", "tsvsa", "xdrty", "dcbejb", "twxul", "fozhwha", "hkehs", "mclhfm", "kfxfpx", "oplmpq", "cmfzuu", "rmbyhmf", "rcivkmz", "mgabniw", "hghapx", "wmoxvuk", "kupmpud", "snspozp", "zveqzy", "omxxlfq", "gaill", "lpazav", "kxywrju", "lcgtepu", "zbmlcl", "lpzhv", "pszeto", "vzmbso", "kbokpl", "uoqmat", "fdkwjg", "kytvxew", "gzzreyo", "wxdyynx", "twchm", "lsxbxma", "tzbva", "fnazkc", "qmvpa", "mxoiz", "nmxzmn", "ufimada", "dvrow", "tqxxsd", "xucms", "loraesj", "mbqdp", "mkcnovs", "pmvip", "uksrfu", "ngxcbel", "acbgch", "jynevd", "pewhh", "rtuymc", "jxqvb", "ylrdr", "nfbnsxo", "blcyz", "twndeik", "dnfku", "yrckw", "ozzqt", "bxftit", "ooidimg", "mpvgc", "otobnvo", "fbczc", "paybdj", "yedrbz", "qwlijd", "uyamzc", "cehtizz", "xejofd", "hlvqt", "iracei", "ppjlp", "jymqay", "vbdtxw", "svhdn", "srylnl", "arpbta", "yiasrg", "chmlmof", "oaoagf", "ntiwo", "heuvqrv", "ygudcn", "ujoxgw", "vcxysn", "xxvbcz", "gubka", "lcteegl", "mfjqu", "jmrll", "xmpefxb", "fxhlx", "qgtcw", "itldt", "xbhhno", "wjlkr", "mkoumfo", "clccuxo", "ksflxgu", "cviwbab", "ggxcbmm", "aosxdgi", "ucaqtvm", "tzkquj", "dcdjfl", "vykusrg", "ayxfjy", "vejuy", "bnqxwd", "fnrbwd", "uvkjmu", "rgneg", "wcqrldl", "lokksi", "evoqgp", "xzpvts", "xbjudib", "zdpttvp", "tbvbi", "pzvfn", "giicqi", "cyjsrd", "vvyvdn", "trvxk", "xkwzirg", "smzaoc", "jvpncjy", "carcxzy", "azmnrz", "tkffh", "kalra", "emoowz", "qfjcz", "tbcpi", "unmas", "fxdhi", "wegea", "vjnbmu", "hbxxa", "updrj", "kanisyn", "qzqfa", "rbyfleo", "gvpud", "vvrnda", "ntgcz", "niiqd", "okmqocr", "hlmuoir", "cllmy", "pvgcyui", "klubnzd", "henjf", "ucmilyk", "bdzvhvy", "zifmo", "cidvxii", "unfcw", "uzsgfv", "rvimhmz", "rrneanz", "tmtptt", "wwdzgb", "kxlofp", "muvdf", "ojlkit", "xjioe", "hdmrl", "uotxsd", "wblmhvw", "kyatg", "lueyjj", "edcqlhh", "yigtdu", "mkqvux", "ognxpmw", "obdpmbo", "doguzpy", "pmeuq", "egkwgm", "zmjps", "blxurlk", "tcdsvz", "cpttk", "oones", "zulotp", "bbjmmft", "qkchbbb", "ddoyf", "qwykri", "rtdhc", "xzeopey", "dwwzu", "absoj", "pyhxrz", "xkzppy", "hukvxis", "mrlzdcn", "rowai", "jehovhy", "ctrho", "icfhdp", "mjgmdju", "hxujna", "bzmfac", "hpnpfvb", "zhnnuzl", "exfpqk", "uusye", "abklkm", "hpwybsm", "pttzcdz", "mmkao", "uxkqle", "mllnhh", "gqggto", "mgntzzx", "xtdef", "xdhgjq", "bkvcqzj", "grvdv", "agjof", "nxxonak", "ssdwci", "wjkcwl", "bvgwiaw", "aehhhox", "miyxnt", "ztjbho", "npuynrk", "qnjch", "urwuyw", "hjclv", "qhbvvt", "enyzud", "pfeyzwd", "fozvoz", "zisyj", "hzdbri", "wyylyi", "fjvwf", "svfmn", "edhcu", "eprzr", "vbhsezf", "isudgte", "qszip", "ilqnce", "rmrjlw", "opaweid", "juzdv", "ehtiv", "yzcosn", "rimplj", "yhdre", "onklj", "xyrzj", "fpkebll", "hvjyjkb", "koczlof", "iovlifd", "uqvvw", "xyfueng", "twynd", "ktmkxzq", "qcvwd", "uxnjdh", "exzkjjx", "vefasx", "ufgtg", "cmllk", "whqpy", "uiqka", "lxnwzw", "jblxgd", "dxvuvf", "llxqaz", "qzxqeq", "smfiri", "qwalddg", "qqkianf", "oshgkag", "qalgka", "sedaqv", "logbadp", "hmklzj", "qdqcqj", "cdwcudk", "sqgvhsh", "llloqjx", "binnlcs", "fjaow", "uirnxyz", "zffqat", "akdzyhn", "pmcwu", "elnge", "uyelt", "uzsod", "qwfarib", "lowtshb", "wgzaiwm", "xzcppu", "azfoudu", "zvargi", "mhospi", "bfqemy", "krhnt", "dolixge", "ofpqew", "xjslrou", "djjueg", "nbjtp", "zahjb", "vdbxeg", "vooqz", "hflenpk", "xpyxqmq", "wkkdtd", "cfcgj", "unrprg", "keszevs", "cequp", "hsjio", "ayprq", "alpzyk", "erikrmm", "ftxfgde", "lopqyg", "oxlqbi", "tiiht", "itanzk", "vpduf", "uxbgkqt", "vztwrdf", "bcqleo", "zbrteyu", "mzhvxw", "esnlm", "uctdwz", "dmhnw", "dhoqk", "ulsokg", "ecceh", "lfkyscl", "turgt", "jctmib", "psrlmq", "gdwpniq", "hahedwt", "ajbigo", "qtfmiv", "dtzij", "oceesy", "hothyg", "vfadpdf", "hppiu", "pjgiee", "isxxbpp", "dwnoh", "cgnill", "zufyk", "mpoeo", "pqyxc", "ehpyix", "aulgyr", "dtdvk", "snlmd", "uswfmev", "jhypcm", "nreeygx", "sjbuqp", "uajrx", "bvgci", "cktys", "mioopek", "tojhyqu", "hihlal", "lhviecc", "kczwrkd", "belivo", "gcxlt", "vtqorps", "fdvnwku", "kllox", "xgnyfqr", "xwvfqa", "hshmm", "lugfp", "ugcxki", "yiyylah", "imjcspq", "lpsts", "ifvkz", "veheym", "yxbrib", "wyhpjhn", "izwaqvn", "kjpdj", "chcnl", "tbxld", "rskqzjm", "fisxhi", "dwepxp", "cfxjbl", "mjqpe", "renbc", "lnqdq", "psyhms", "unqmse", "mlivyuw", "ajzrmjt", "fmmsrx", "ggvwrg", "evnhtbx", "ednufjc", "goows", "olofgl", "wpfrr", "wuvype", "fwjto", "vnazt", "ujrhkec", "noxme", "pbkaz", "larkdu", "ebuxauc", "vkjqer", "ldelp", "sojxqfg", "wbvbut", "qgsooz", "ixtgd", "qioslp", "pqgua", "mfnvz", "fkinlrh", "qtenoc", "syenus", "fkplm", "qvlies", "unolnf", "bftvtl", "ifzbp", "zckbjz", "rwokr", "iqipnz", "nyrsnty", "klneq", "rtizom", "nzxvaf", "kwsknn", "delmgu", "lvrtoi", "xgpcn", "zovahx", "kqykd", "zllzd", "ciskyi", "qmkow", "zwbwgni", "qixaqyp", "bbpdxz", "gpyddcr", "emwcbkv", "qymwpuk", "gzfwr", "bqtsjm", "zzjuarn", "tuczqbf", "focyyew", "aajkpt", "doxpudb", "iihqftz", "iplmetd", "awzllw", "mjafnh", "gzqmt", "bcbqbek", "wkpda", "hdhnced", "vescmqn", "tvsof", "ontvba", "ywmawy", "yzucwi", "fqziiur", "pmydwpt", "dliolrc", "jnsou", "tvswwhb", "yogoial", "vayef", "fwvhh", "wwlck", "mrzrjcx", "xzqxcif", "irynybr", "gzyqisa", "lnflfzy", "xmepwne", "unyjrem", "zgblsf", "rtmomdy", "eshld", "xmwikj", "fnupbcw", "fcipz", "uciehpe", "kmtnut", "ectqzea", "swrit", "frrchku", "swcgsu", "shkxvt", "zjjcx", "gtcez", "xblhk", "gubhe", "pnaoos", "yypewih", "cbzbk", "jjxbq", "nzqycdl", "mrjjfyk", "itkzfhc", "uambd", "gictm", "atwntt", "cenrao", "hzmlgfv", "cyamfon", "pldrrnv", "ebtzqx", "jonga", "ktgmiy", "qiqseiz", "npitnk", "fzwuen", "mvxhb", "obidnqw", "plola", "pijaf", "jistxtn", "dcxxk", "ruxbphm", "qzaneb", "ioyqmy", "wayuno", "wbvmck", "pmcxo", "qtada", "kbxnj", "knhmjtl", "kiqxiro", "jcpsi", "cyhvmo", "hsomp", "tkxxf", "mneqtp", "ntrcat", "wgvgmr", "varaytv", "pbida", "yqolnz", "chxwvp", "vchgf", "hohypb", "zohgdc", "xspsy", "hxaefb", "zaomwg", "ghpniya", "vvsmcwk", "ycnxjh", "hyrkc", "zmlyxmy", "nxwrij", "vgnda", "scpzuwu", "ibnbzhk", "tmavs", "bvdhfbl", "cjudij", "udgqjbs", "svyrq", "kmhthi", "prapa", "xlibves", "dqddqmx", "tqcipdw", "uqgrhl", "fczoo", "pptncy", "vvaylkt", "xjznf", "zdjori", "atuzhd", "qmttkmb", "rsfkvw", "rqxscu", "rxrwc", "zvptpuc", "ahdvce", "ftaidk", "apahhfj", "iskrwxa", "ellsp", "lwjvg", "rcbsw", "dtbmi", "ejwti", "hdyzyf", "gbmdm", "gmrzr", "jbgje", "hnuapiv", "yogxasw", "kjuxrxi", "ejjzwq", "qthpshr", "ufqqa", "drswm", "sqcdrm", "zharf", "duefy", "pfrsnfs", "ywygkk", "debqn", "ttsbv", "jqoqn", "dtwopta", "psgxiz", "gpuiy", "rtghkgu", "qcmhksu", "lcoseb", "vzewq", "gxiux", "ryqht", "nrljfdm", "dztatif", "lkehf", "rmrox", "rnntci", "zhliree", "rlfpo", "dpdup", "qhjspn", "hpsqhi", "wbnub", "pwgkle", "bldsutn", "nhugm", "llxvj", "nkulvoy", "aihuf", "lqflwp", "lekamz", "fdnfln", "fjtplf", "zinbih", "jvqovhr", "ehmlp", "qaprv", "mdnfd", "xjgon", "nqsdbj", "odrjtab", "qzsjq", "ripgmer", "ljgsxt", "sciqi", "yaqykph", "rfunhjy", "abygu", "ibldxl", "fhsgodn", "lnneny", "clcemc", "pviqaqg", "ywpchy", "baksyet", "tnfmw", "dkpvx", "bykxod", "qwzrn", "kmrfrv", "asxodt", "yuismpd", "cxfcrc", "kbkioi", "ivspipn", "vmjcb", "kpnotnf", "jncttso", "mvoexeu", "gxgkb", "ihpszdp", "ihuzlsb", "ztyzdp", "gsvmymx", "ldhfbb", "wmjymr", "gbcjub", "ltxge", "picika", "qhjywi", "ctxwfma", "awnzi", "cgdwc", "gyfpuzr", "taqohj", "bdmeo", "zwrsref", "fhixq", "drvryni", "lmgsd", "rihhz", "twwhyy", "bhzob", "mwypg", "nrmyzv", "pmfvmst", "mizvjy", "tdsfg", "weoma", "ckrzl", "zvcgqz", "pjnuw", "nqrde", "qcnem", "grhis", "nqozqd", "gefinct", "ipmzvrp", "rgiqruj", "eoqdeva", "dimxz", "ixrhlpt", "bfwkm", "ufwjp", "aoszp", "ahpyp", "hghcyv", "rqlti", "pcpnpo", "efxyxdm", "atgcrj", "okadwcw", "igavnan", "bfxqc", "tdvdr", "zretcfp", "siymap", "tugzn", "wulwhre", "lmfqz", "ixjsxwc", "gsozyoj", "bdolsf", "korwx", "fvlpk", "kuebj", "ublpu", "ciglmvs", "siwqcdx", "xclnxlf", "vdycdl", "utsoyxq", "ugjnsxj", "hppqtce", "ciijifs", "mxbyw", "ptwill", "rbahig", "twafrt", "qgppawc", "terobw", "qcjpv", "aauvybv", "wjfbvx", "hrmfd", "ibtwu", "bnrgqm", "lrloxuk", "rzippvx", "cbjekyh", "cggdym", "czynzdj", "qurxnfa", "mclrra", "byxfrrp", "vcryit", "umkva", "zulxwp", "sfvjsyl", "lvosyl", "mfjfprv", "pudrmc", "liineqn", "jqrfff", "apgrfu", "xusxh", "vbbla", "unvsvm", "zhaax", "ztcnucd", "iuhnod", "meeglt", "lyvaoq", "pqjhuq", "afsjig", "mrnffa", "vngwa", "fveunc", "vmvnx", "wxdxosn", "hfwybx", "fmwna", "qnbxae", "rrmyoax", "rnjhywy", "vstnd", "ewnllhr", "wsvxenk", "cbivijf", "nysamc", "zoyfna", "uotmde", "zkkrpmp", "ttficz", "rdnds", "uveompq", "emtbwb", "drhwsf", "bmkafp", "yedpcow", "untvymx", "yyejqta", "kcjakg", "tdwmu", "gecjncx", "cxezgec", "xonnszm", "mecgvq", "kdagva", "ucewe", "chsmeb", "kscci", "gzoia", "ovdojr", "mwgbxe", "gibxxlt", "mfgpo", "jkhob", "hwquiz", "wvhfaia", "sxhikny", "dghcawc", "phayky", "shchy", "mklvgh", "yabxat", "rkmrfs", "pfhgrw", "wtlxebg", "mevefcq", "uvhvgo", "nldxkdz", "dwybxh", "ycmlybh", "aqvod", "tsvfhw", "uhvuc", "wcsxe", "afyzus", "jhfyk", "vghpfv", "nprfou", "vsxmc", "hiiiewc", "uehpmz", "jzffnr", "twbuhn", "ahrbzqv", "rvmffb", "vrmynfc", "upnuka", "jghpuse", "dwrbkhv", "nveuii", "nefmnf", "aowjzzo", "yfcprb", "ojihgh", "jfnit", "ovkpf", "bhyqx", "enyrhm", "ljqxp", "pzpfjr", "qligbi", "udoqp", "naxqyjp", "jriibb", "iccscme", "rhnwh", "xfajbc", "gopeq", "kurqqru", "qyzpd", "twfaem", "nopsy", "yqcpwa", "xzhoc", "rwval", "zqhyid", "mnmaobk", "bzsxfa", "kmgqo", "quxchux", "mimqbx", "djuok", "injzi", "nekayg", "oiyytj", "vgwdob", "epmbtws", "whwkeph", "ddfwxo", "nlobf", "adrqb", "lzzownl", "iuhka", "upfjos", "kjiua", "xjgud", "qqqnwqc", "bgvooqf", "qjurybc", "ufsnhxp", "fjpkb", "pztffxh", "qeqcgg", "tfills", "rkmbus", "wpsmuk", "moqeh", "nyiayg", "bejhle", "gszvfjw", "fnskvxi", "nhxyzxi", "trwseu", "jdnptzx", "fiotq", "xspgs", "ddnyc", "yhxjxus", "hkwrzd", "rmvsyi", "eqbjf", "gymahyo", "vuxso", "ekagz", "vozvpu", "euzcdla", "qvernpp", "seejev", "tetez", "eosct", "fxuicyl", "mwyzg", "qeujko", "gpnizxr", "azxslf", "faepd", "nsvcr", "rxcty", "kmtnoe", "tuwoxf", "xewnebm", "qlegtb", "qxlust", "qnlje", "ptdlpvq", "tjmwt", "nddiu", "qanqplx", "kxckhbq", "lvtyy", "cqwdax", "irvigyr", "mpdqgvy", "qbvysre", "ezluyj", "qshkht", "fjxyezs", "lquxor", "rxtgdy", "ezlzb", "addqjj", "fucytk", "mmbjy", "gtkjcnz", "fourguz", "ffhtah", "yhyxwcm", "svmofbn", "gvzve", "cizjcea", "vkdtt", "hdivkwt", "utnjaf", "svvrkeh", "qyxpd", "qlinqj", "xvesol", "bykuhwp", "mjodd", "trurbet", "ahzxm", "hkxhvo", "bhccyxf", "elobjqo", "igdxmj", "twkdf", "gmogg", "lzmljtj", "jhgrq", "ndiye", "sgaaavr", "mxxvrkm", "vyvvi", "pcafw", "cverpds", "bvpjmw", "pcqzlg", "fmwhf", "ctviwh", "tgmjzsd", "uvtwwy", "pbxhcmg", "tbiwyru", "efzimj", "dcujj", "lxbndb", "ysbhy", "lqwnjdz", "ontmb", "dfsxzto", "ubwbyv", "htjmvu", "ahzxszy", "ivttau", "cfimiy", "fkjfmw", "gscep", "bwdjojj", "knwosp", "gznvty", "izgfoyl", "zayof", "jqjpk", "vosohad", "xjqtry", "zdgvx", "cbgvmn", "iskhag", "qdzxb", "lfivyh", "ltpzk", "wexodoi", "zheod", "wtamnc", "lnjhy", "bwozgnh", "dvdpsy", "puayd", "sogsxu", "fzylgp", "kotukif", "pwfjx", "vnecbvd", "zgojjum", "byuzv", "lxwfio", "enqpgs", "lguax", "ztfnyqt", "bbbbrq", "bfqcd", "poalx", "amyfb", "rmuyan", "anqopg", "rovev", "pafiqmd", "uxjiaaz", "kyskun", "kdyzd", "dnvyel", "ljwmn", "nosgpxo", "wplvwil", "orcwe", "xhyuj", "ogueh", "taovv", "zodzsc", "rdiut", "fiyny", "qmwccp", "oqgpqv", "ipsmwz", "rvnanf", "vhjcem", "hevsn", "sxdsmg", "zxerju", "qqmvrn", "jpqzy", "yenlp", "nmitc", "bakwo", "ixmrhxx", "faypb", "bbzsmgw", "opulvn", "qnugsr", "kpidsbl", "dukzjpq", "bbybu", "wjausnl", "jmzkjv", "uygdm", "sejdzga", "fxkyhn", "xwgvw", "oxxzvlr", "kowjho", "ipwkmjc", "fjrxk", "rrzkdgs", "bxghaq", "gbhoqa", "xnaprd", "vrjus", "prpqp", "zayukll", "ieaarp", "xfcozp", "yofdlo", "vquhofn", "prlictl", "akseu", "fqlybv", "crpvuzw", "bsvzr", "mwdcfdr", "dhcmcu", "hiocm", "xivqrr", "yvcmo", "svwsfr", "uwopkxy", "ougre", "yfpmzlw", "ycsbch", "wlrdnre", "jrdhn", "ssjkca", "tndje", "nzebm", "ozyobeo", "puerg", "aaeqauo", "gswil", "iwcxgji", "tauimn", "kbpdwlk", "vltzl", "watqld", "ghqrm", "pkravau", "mjfbxv", "bzifdx", "ufszjkr", "xodqa", "vopisyg", "ppytrz", "ioqlech", "ixvtpg", "sgpeoa", "avsvj", "iwobycm", "ycnvobh", "lnexix", "fgogr", "atdwdil", "vcsbk", "iopjwyx", "moxoyua", "vncee", "cfqiwxh", "ttbkbh", "xearpw", "jzfsl", "shpxr", "wyrrbm", "imrjybd", "adufra", "msedvi", "hgfyd", "yofpdh", "zjwycb", "dcleww", "ruacjb", "yjwelwi", "dagoiud", "vavunu", "xlxbcmc", "urqksfd", "tngbww", "kwjhnl", "gekdht", "jlkzfgv", "lexqhx", "cnmynkc", "ebenz", "rwdopf", "wnetkj", "mcfbo", "gtevzv", "odvil", "shkifu", "aovbq", "vibnyno", "tcmlmkz", "rfpgk", "gohtjwc", "mwmfeq", "wzxmz", "jyufim", "bniivjc", "mozrlzt", "rcwje", "nykfvh", "ezglkh", "nqkpvj", "tyqwypw", "udzlzyz", "iixxey", "dlyaq", "ugksuyk", "sxaco", "tkpokn", "ykglu", "uwzorpp", "fhuxz", "dqfyv", "xnlgoe", "bpohjte", "smlty", "vhght", "nmreqxa", "reouy", "abqju", "ramtsu", "ektbvhz", "ercmpc", "opchcx", "ajhrj", "hkvalb", "ucngyjf", "zoltae", "ryjhfiv", "lgjscrc", "mnbkms", "odbjs", "ywbvys", "jjcvh", "vzkojje", "ttohufl", "gvnoaj", "jkyhavl", "czsbrxu", "lhhrdn", "nhmuatv", "eityul", "aabelb", "limct", "oooxwis", "tmvxpv", "xbeiqh", "fcwcc", "qjhdcq", "wbyplq", "zftnk", "epcdy", "kptee", "qipzud", "viytsl", "bzhwvj", "pmkpud", "aqpunv", "jsxetb", "gxeljex", "iaebpo", "dihzj", "zftby", "vkzra", "hejaidb", "djvtqt", "vazqo", "iugtsp", "lxvtoin", "kwyxpwj", "ehpnrp", "iivjvkn", "vdhwfj", "afyavpl", "yoiht", "colenpr", "iohrx", "khuljuj", "iwtjh", "gnqncp", "vdhwm", "yhxfw", "rsrig", "qpgym", "gbalr", "gqhdmz", "cxsimhf", "muonsb", "swfwyyi", "ihnnk", "hrzoc", "uixhtym", "rjjtpn", "efzgwq", "rubgndx", "rffpmk", "rllab", "cyrfk", "ssvoz", "ttzhop", "zhywy", "utzix", "oklvooj", "kdslj", "qjohyod", "ulnqss", "dppso", "xhyjlff", "elazc", "qdimsq", "ozzaprn", "pusmfw", "vqopa", "fguvxwd", "luerv", "ylgvs", "qixlgz", "btwyq", "exxthjr", "gmcmk", "vdovgma", "uxaqwjn", "rzdlo", "yjknn", "yrxygac", "vocejbl", "wnfki", "aabtp", "aohxnt", "evgftbl", "ppsraw", "xwjin", "bryhke", "mhwlj", "rnnfh", "vfmsxq", "znxzwm", "yilmhgj", "gqdvp", "lnuln", "ltjtpt", "fhrhkcw", "dvsalfh", "soytv", "kexst", "sjblwo", "wiblqa", "hzikex", "cqjlf" ] # print(s.minimumLengthEncoding(temp)) a = s.minimumLengthEncoding(temp) b = Solution1().minimumLengthEncoding(temp) print(a, b) # print(sum(len(x) + 1 for x in a)) # print(sum(len(x) + 1 for x in b)) # for x in a: # if x not in b: # print(x)
def set_elements_sum(a, b): c = [] for i in range(len(a)): result = a[i] + b[i] c.append(result) return c ll = [1, 2, 3, 4, 5] ll2 = [3, 4, 5, 6, 7] print(set_elements_sum(ll, ll2)) # [4, 6, 8, 10, 12]
# URI Online Judge 1133 X = int(input()) Y = int(input()) soma = 0 if Y < X: X, Y = Y, X for i in range(X,Y+1): if i%13!=0: soma += i print(soma)
salario = float(input()) if (salario >= 0 and salario <= 2000.00): print('Isento') elif (salario >= 2000.01 and salario <= 3000.00): resto = salario - 2000 resul = resto * 0.08 print('R$ {:.2f}'.format(resul)) elif (salario >= 3000.01 and salario <= 4500.00): resto = salario - 3000 resul = (resto * 0.18) + (1000 * 0.08) print('R$ {:.2f}'.format(resul)) elif (salario > 4500.00): resto = salario - 4500 resul = (resto * 0.28) + (1500 * 0.18) + (1000 * 0.08) print('R$ {:.2f}'.format(resul))
for i in range(int(input())): a, b, c = map(int, input().split()) mi = min(a, b) ma = max(a, b) half_circle_people = (ma - mi) full_circle_people = 2 * half_circle_people if ma > half_circle_people * 2 or c > full_circle_people: print(-1) else: print((c - half_circle_people - 1) % full_circle_people + 1)
# model settings model = dict( type='Recognizer3DRPL', backbone=dict( type='ResNet3dSlowOnly', depth=50, pretrained='torchvision://resnet50', lateral=False, out_indices=(2, 3), conv1_kernel=(1, 7, 7), conv1_stride_t=1, pool1_stride_t=1, inflate=(0, 0, 1, 1), norm_eval=False), neck=dict( type='TPN', in_channels=(1024, 2048), out_channels=1024, spatial_modulation_cfg=dict( in_channels=(1024, 2048), out_channels=2048), temporal_modulation_cfg=dict(downsample_scales=(8, 8)), upsample_cfg=dict(scale_factor=(1, 1, 1)), downsample_cfg=dict(downsample_scale=(1, 1, 1)), level_fusion_cfg=dict( in_channels=(1024, 1024), mid_channels=(1024, 1024), out_channels=2048, downsample_scales=((1, 1, 1), (1, 1, 1)))), cls_head=dict( type='TPNRPLHead', loss_cls=dict(type='RPLoss', temperature=1, weight_pl=0.1), num_classes=101, in_channels=2048, spatial_type='avg', consensus=dict(type='AvgConsensus', dim=1), dropout_ratio=0.5, init_std=0.01)) evidence='exp' # only used for EDL test_cfg = dict(average_clips='prob') dataset_type = 'VideoDataset' img_norm_cfg = dict( mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_bgr=False) test_pipeline = [ dict(type='OpenCVInit', num_threads=1), dict( type='SampleFrames', clip_len=8, frame_interval=8, num_clips=10, test_mode=True), dict(type='OpenCVDecode'), dict(type='Resize', scale=(-1, 256)), dict(type='ThreeCrop', crop_size=256), dict(type='Normalize', **img_norm_cfg), dict(type='FormatShape', input_format='NCTHW'), dict(type='Collect', keys=['imgs', 'label'], meta_keys=[]), dict(type='ToTensor', keys=['imgs']) ] data = dict( videos_per_gpu=2, workers_per_gpu=2, test=dict( type=dataset_type, ann_file=None, data_prefix=None, pipeline=test_pipeline))
def make_divider(): return {"type": "divider"} def make_markdown(text): return {"type": "mrkdwn", "text": text } def make_section(text): return {"type":"section", "text": make_markdown(text)} def make_context(*args): return {"type":"context", "elements": [*args]} def make_blocks(*args): return [*args]
# generated from catkin/cmake/template/pkg.context.pc.in CATKIN_PACKAGE_PREFIX = "" PROJECT_PKG_CONFIG_INCLUDE_DIRS = "/home/nvidia/linorobot_ws/src/imu_calib/include;/usr/local/include/eigen3".split(';') if "/home/nvidia/linorobot_ws/src/imu_calib/include;/usr/local/include/eigen3" != "" else [] PROJECT_CATKIN_DEPENDS = "cmake_modules;roscpp;sensor_msgs;lino_msgs".replace(';', ' ') PKG_CONFIG_LIBRARIES_WITH_PREFIX = "-laccel_calib".split(';') if "-laccel_calib" != "" else [] PROJECT_NAME = "imu_calib" PROJECT_SPACE_DIR = "/home/nvidia/linorobot_ws/devel" PROJECT_VERSION = "0.0.0"
numero = int(input("Entre com um numero inteiro e menor que 1000: ")) if numero > 1000: print("Numero invalido") else: unidade = numero % 10 numero = (numero - unidade) / 10 dezena = int(numero % 10) numero = (numero - dezena) / 10 centena = int(numero) print(f"{centena} centena(s) , {dezena} dezena(s) e {unidade} unidade(s)")
def str_to_bool(s): if isinstance(s, bool): # do not convert if already a boolean return s else: if s == 'True' \ or s == 'true' \ or s == '1' \ or s == 1 \ or s == True: return True elif s == 'False' \ or s == 'false' \ or s == '0' \ or s == 0 \ or s == False: return False return False
"""Version ========== """ __version__ = "0.4.0"
class Solution: def compareVersion(self, version1: str, version2: str) -> int: ver1 = version1.split('.') ver2 = version2.split('.') def removeLeadingZeros(s): while len(s) > 1 and s[0] == '0': s = s[1:] return s ver1 = [removeLeadingZeros(ver1[i]) for i in range(len(ver1))] ver2 = [removeLeadingZeros(ver2[i]) for i in range(len(ver2))] i = 0 while i < max(len(ver1), len(ver2)): v1 = ver1[i] if i < len(ver1) else 0 v2 = ver2[i] if i < len(ver2) else 0 i += 1 if int(v1) > int(v2): return 1 if int(v1) < int(v2): return -1 return 0
GUIDs = { "ASROCK_ACPIS4_DXE_GUID": [69196166, 45078, 18382, 175, 197, 34, 105, 237, 212, 173, 100], "ASROCK_USBRT_GUID": [82487969, 10657, 4567, 136, 56, 0, 80, 4, 115, 212, 235], "ASROCK_RAID_SETUP_GUID": [152494882, 14144, 12750, 173, 98, 189, 23, 44, 236, 202, 54], "ASROCK_RAID_LOADER_GUID": [164506669, 19843, 17592, 151, 208, 16, 133, 235, 84, 144, 184], "ASROCK_SIOSLPSMI_GUID": [204970154, 53806, 19926, 140, 180, 60, 156, 251, 29, 134, 211], "ASROCK_PLEDDXE_GUID": [260599413, 12329, 20175, 182, 148, 34, 137, 77, 63, 33, 67], "ASROCK_A_DEFAULT_DXE_GUID": [303480106, 49246, 19565, 145, 231, 235, 142, 55, 173, 59, 122], "ASROCK_USER_DEF_SETUP_DXE_GUID": [321832763, 48422, 20415, 177, 147, 138, 203, 80, 239, 189, 137], "ASROCK_WAKEUP_CTRL_SMM_GUID": [460234064, 4836, 19285, 129, 217, 26, 191, 236, 89, 212, 252], "ASROCK_AMI_AGESA_DXE_GUID": [503020538, 49038, 19729, 151, 102, 47, 176, 208, 68, 35, 16], "ASROCK_HDD_READY_SMI_GUID": [560462180, 29336, 19087, 154, 42, 191, 228, 152, 214, 0, 168], "ASROCK_MOUSE_DRIVER_GUID": [719032155, 51156, 20094, 190, 42, 35, 99, 77, 246, 104, 161], "ASROCK_IDESMM_GUID": [829100592, 1280, 17810, 140, 9, 234, 186, 15, 182, 176, 127], "ASROCK_BFGSMI_GUID": [978522445, 22131, 19929, 181, 179, 203, 114, 195, 71, 102, 155], "ASROCK_ASRLOGODXE_GUID": [1033880909, 6629, 19152, 185, 134, 2, 214, 135, 215, 96, 229], "ASROCK_ASM104_X_DXE_GUID": [1080004582, 21011, 19333, 184, 33, 151, 183, 122, 255, 121, 91], "ASROCK_HDAUDIO_SMI_GUID": [1254707048, 58961, 19256, 161, 216, 45, 93, 239, 250, 15, 96], "ASROCK_SM_BUS_DXE_GUID": [1265110573, 3427, 20322, 185, 48, 122, 233, 149, 185, 179, 163], "ASROCK_USBINT13_GUID": [1275096281, 6586, 17943, 132, 131, 96, 145, 148, 161, 172, 252], "ASROCK_SLP_SUPPORT_GUID": [1279872597, 22601, 21314, 69, 84, 84, 69, 82, 33, 33, 33], "ASROCK_PATA_CONTROLLER_GUID": [1334921163, 38702, 20316, 184, 105, 160, 33, 130, 201, 217, 60], "ASROCK_SATA_CONTROLLER_GUID": [1359869601, 46785, 18760, 174, 231, 89, 242, 32, 248, 152, 189], "ASROCK_ACPIS4_SMM_GUID": [1368992111, 10248, 19194, 148, 196, 153, 246, 176, 108, 135, 30], "ASROCK_POST_REPORT_GUID": [1413923475, 13211, 18381, 183, 25, 88, 93, 227, 148, 8, 204], "ASROCK_CLOCK_GEN_DXE_GUID": [1447053695, 25694, 17937, 185, 21, 230, 130, 200, 189, 71, 131], "ASROCK_UHCD_GUID": [1477302528, 14429, 4567, 136, 58, 0, 80, 4, 115, 212, 235], "ASROCK_LEGACY_REGION_GUID": [1495543256, 59343, 18809, 182, 14, 166, 6, 126, 42, 24, 95], "ASROCK_SLEEP_SMI_GUID": [1654193688, 54767, 17079, 187, 12, 41, 83, 40, 63, 87, 4], "ASROCK_CMOS_MANAGER_SMM_GUID": [1751762355, 44173, 18803, 139, 55, 227, 84, 219, 243, 74, 221], "ASROCK_AMD_AGESA_DXE_DRIVER_GUID": [1766895615, 28387, 4573, 173, 139, 8, 0, 32, 12, 154, 102], "ASROCK_RE_FLASH_GUID": [1893836824, 3041, 17481, 191, 212, 158, 246, 140, 127, 2, 168], "ASROCK_LEGACY_INTERRUPT_GUID": [1911362257, 9483, 17147, 140, 23, 16, 220, 250, 119, 23, 1], "ASROCK_SMM_CHILD_DISPATCHER_GUID": [1966485705, 64229, 18345, 187, 191, 136, 214, 33, 205, 114, 130], "ASROCK_BFGDXE_GUID": [1988600983, 65358, 18687, 188, 170, 103, 219, 246, 92, 66, 209], "ASROCK_IFLASHSETUP_GUID": [2011543064, 9746, 19496, 188, 223, 162, 177, 77, 138, 62, 254], "ASROCK_S4_SLEEPDELAY_GUID": [2075935011, 23902, 19484, 149, 209, 48, 235, 164, 135, 1, 202], "ASROCK_HDD_READY_DXE_GUID": [2179248970, 9868, 20428, 142, 57, 28, 29, 62, 111, 110, 105], "ASROCK_RTLANDXE_GUID": [2332955475, 13708, 20015, 147, 69, 238, 191, 29, 171, 152, 155], "ASROCK_AMD_SB900_DXE_GUID": [2333274783, 28981, 20139, 175, 218, 5, 18, 247, 75, 101, 234], "ASROCK_SB900_SMBUS_LIGHT_GUID": [2551896525, 34437, 19115, 175, 218, 5, 18, 247, 75, 101, 234], "ASROCK_AAFTBL_SMI_GUID": [2667102838, 46054, 19161, 143, 231, 199, 79, 113, 196, 114, 72], "ASROCK_NVRAMID_GUID": [2708185858, 25876, 17031, 190, 227, 98, 35, 183, 222, 44, 33], "ASROCK_IDE_SECURITY_GUID": [2847342799, 414, 19851, 163, 167, 136, 225, 234, 1, 105, 158], "ASROCK_ASM1061_DXE_GUID": [2848876245, 27959, 17694, 169, 191, 245, 143, 122, 11, 60, 194], "ASROCK_ASM104_X_SMI_GUID": [2904508538, 47702, 18652, 142, 170, 232, 251, 234, 116, 184, 242], "ASROCK_RTLANSMI_GUID": [3005543067, 24215, 19449, 180, 224, 81, 37, 193, 246, 5, 213], "ASROCK_GEC_UPDATE_SMI_GUID": [3092850716, 5882, 17832, 146, 1, 28, 56, 48, 169, 115, 189], "ASROCK_APMOFF_GUID": [3146872289, 16021, 19326, 135, 80, 157, 106, 163, 78, 183, 246], "ASROCK_SMIFLASH_GUID": [3157425597, 47490, 20309, 159, 121, 5, 106, 215, 233, 135, 197], "ASROCK_RAID_X64_GUID": [3295196034, 17744, 18697, 173, 87, 36, 150, 20, 27, 63, 74], "ASROCK_AMD_SB900_SMM_GUID": [3351810409, 6722, 20062, 179, 75, 230, 131, 6, 113, 201, 166], "ASROCK_FIREWIRE_GUID": [3367390790, 38937, 17835, 135, 93, 9, 223, 218, 109, 139, 27], "ASROCK_IDE_SMART_GUID": [3581707566, 32927, 17871, 163, 119, 215, 123, 192, 203, 120, 238], "ASROCK_SB_INTERFACE_DXE_GUID": [3622218689, 38683, 17947, 181, 228, 60, 55, 102, 38, 122, 217], "ASROCK_AMD_SB900_SMM_DISPATCHER_GUID": [3748899802, 31298, 20062, 179, 75, 230, 131, 6, 113, 201, 166], "ASROCK_AMDCPU_DXE_GUID": [3786566962, 16719, 18139, 154, 238, 66, 0, 119, 243, 93, 190], "ASROCK_SMBIOS_DMIEDIT_GUID": [3802613560, 35124, 18677, 132, 18, 153, 233, 72, 200, 220, 27], "ASROCK_SECURITY_SELECT_DXE_GUID": [3832130086, 37480, 20144, 160, 135, 221, 76, 238, 55, 64, 75], "ASROCK_FILE_EXPLORER_LITE_GUID": [3875982164, 33976, 16573, 131, 47, 127, 178, 213, 203, 135, 179], "ASROCK_PLEDSMM_GUID": [3911953940, 15869, 19568, 159, 230, 56, 153, 243, 108, 120, 70], "ASROCK_CPU_SMBIOS_DRIVER_GUID": [3930959592, 43089, 19103, 171, 244, 183, 159, 162, 82, 130, 145], "ASROCK_AAFTBL_DXE_GUID": [4279363330, 35107, 18380, 173, 48, 217, 224, 226, 64, 221, 16], }
lista = [[], [], []] soma=somapar=0 for l in range(3): for c in range(3): if c == 2: n = int(input(f'Digite um valor para [{l}, {c}]: ')) lista[l].append(n) soma += n if n % 2 == 0: somapar += n else: n = int(input(f'Digite um valor para [{l}, {c}]: ')) lista[l].append(n) if n % 2 == 0: somapar += n print('-='*27) for l in range(3): for c in range(3): print(f'[{lista[l][c]:^5}]',end='') print('') print('-='*27) print(f'A soma dos valores pares é {somapar} ') print(f'A soma da terceira coluna é {soma} ') print(f'O maior valor da sagunda linha foi {max(lista[1])}')
""" General unit tests """ class TestClass: def test_base(self): assert 42 == 42
''' Python program to convert the distance (in feet) to inches,yards, and miles ''' def distanceInInches (d_ft): print("The distance in inches is %i inches." %(d_ft * 12)) def distanceInYard (d_ft): print("The distance in yards is %.2f yards." %(d_ft / 3.0)) def distanceInMiles (d_ft): print("The distance in miles is %.2f miles." %(d_ft / 5280.0) ) def main (): d_ft = int(input("Input distance in feet: ")) distanceInInches (d_ft) distanceInYard (d_ft) distanceInMiles (d_ft) main()
# coding=utf-8 # # @lc app=leetcode id=33 lang=python # # [33] Search in Rotated Sorted Array # # https://leetcode.com/problems/search-in-rotated-sorted-array/description/ # # algorithms # Medium (32.65%) # Likes: 2445 # Dislikes: 314 # Total Accepted: 421.1K # Total Submissions: 1.3M # Testcase Example: '[4,5,6,7,0,1,2]\n0' # # Suppose an array sorted in ascending order is rotated at some pivot unknown # to you beforehand. # # (i.e., [0,1,2,4,5,6,7] might become [4,5,6,7,0,1,2]). # # You are given a target value to search. If found in the array return its # index, otherwise return -1. # # You may assume no duplicate exists in the array. # # Your algorithm's runtime complexity must be in the order of O(log n). # # Example 1: # # # Input: nums = [4,5,6,7,0,1,2], target = 0 # Output: 4 # # # Example 2: # # # Input: nums = [4,5,6,7,0,1,2], target = 3 # Output: -1 # # class Solution(object): def _search(self, nums, target): """ :type nums: List[int] :type target: int :rtype: int """ return nums.index(target) if target in nums else -1 def search(self, nums, target): """ :type nums: List[int] :type target: int :rtype: int """ # O(logN) 就是二分 # 先二分找到 旋转点 # 再左右二分找到定位点 # 两次二分,时间复杂度还是二分 if not nums: return -1 start = 0 end = len(nums) - 1 while start < end: mid = (start+end) / 2 if nums[mid] > nums[start]: if nums[mid] < nums[end]: break start = mid else: end = mid # gap = end gap = self.gap(nums, target) if nums[0] <= target <= nums[gap]: start = 0 end = gap else: start = gap + 1 end = len(nums) - 1 while start <= end: mid = (start+end) / 2 if nums[mid] == target: return mid elif nums[mid] < target: start = mid + 1 else: end = mid - 1 return -1 def gap(self, nums, v): if len(nums) < 3: return 0 start = 0 end = len(nums) - 1 while start <= end: mid = (start + end) / 2 if nums[mid] >= nums[start]: if mid+1 >= len(nums) or nums[mid-1] <= nums[mid] >= nums[mid+1]: return mid start = mid + 1 elif nums[mid] < nums[start]: if mid-1 < 0 or nums[mid-1] >= nums[mid] <= nums[mid+1]: return mid - 1 end = mid - 1 # if __name__ == '__main__': # s = Solution() # print s.search([1], 0) # print s.search([], 1) # print s.search([1,3],0) # print s.search([1,3,5], 0) # print s.search([4,5,6,7,0,1,2,3], 0) # print s.search([4,5,6,7,0,1,2,3], 3) # print s.search([5,6,7,0,1,2,4], 3) # # print s.gap([4,5,6,7,0,1,2,3], 0) # # print s.gap([4,5,6,7,0,1,2,3], 3) # # print s.gap([5,6,7,0,1,2,4], 3)
def somme(liste_nombres): pass def moyenne(liste_nombres): pass
class Solution: def solve(self, genes): ans = 0 seen = set() genes = set(genes) for gene in genes: if gene in seen: continue ans += 1 dfs = [gene] seen.add(gene) while dfs: cur = dfs.pop() cur_list = list(cur) for i in range(len(cur)): for char in ["A","C","G","T"]: if char == cur[i]: continue cur_list[i] = char new_gene = "".join(cur_list) if new_gene in genes and new_gene not in seen: seen.add(new_gene) dfs.append(new_gene) cur_list[i] = cur[i] return ans
# 3. Номера строк. Напишите программу, которая запрашивает у пользователя # имя файла. Программа должна вывести на экран содержимое файла, при этом # каждая строка должна предваряться ее номером и двоеточием. Нумерация строк # должна начинаться с 1. number_list.txt def main(): try: name_file = input('Name file + .file extension: ') open_file = open(str(name_file), 'r') count = 1 for content in open_file: content = content.rstrip('\n') print(count, ': ', content, sep='') count += 1 open_file.close() except ValueError: print('ValueError') except FileNotFoundError: print('FileNotFoundError') main()
def ficha(): print(30*'-') n = str(input('Nome do Jogador: ')) if n == '': n = '<desconhecido>' g = str(input('Números de Gols: ')) if g.isnumeric(): g = int(g) else: g = 0 print(f'O jogador {n} fez {g} gol(s) no campeonato.') ficha()
def title1(content): return "<h1 class='display-1'>{}</h1>".format(content) def title2(content): return "<h2 class='display-2'>{}</h2>".format(content) def title3(content): return "<h3 class='display-3'>{}</h3>".format(content) def title4(content): return "<h4 class='display-4'>{}</h4>".format(content) def title5(content): return "<h5 class='display-5'>{}</h5>".format(content) def title6(content): return "<h6 class='display-6'>{}</h6>".format(content) def h1(content): return "<h1>{}</h1>".format(content) def h2(content): return "<h2>{}</h2>".format(content) def h3(content): return "<h3>{}</h3>".format(content) def h4(content): return "<h4>{}</h4>".format(content) def h5(content): return "<h5>{}</h5>".format(content) def h6(content): return "<h6>{}</h6>".format(content) def important(content): return """<div class="lead">{}</div>""".format(content) def small(content): return "<small>{}</small>".format(content) def p(content): return "<p>{}</p>".format(content)
class Constants: # DATA TYPES GENERATE_EPR_IF_NONE = 'generate_epr_if_none' AWAIT_ACK = 'await_ack' SEQUENCE_NUMBER = 'sequence_number' PAYLOAD = 'payload' PAYLOAD_TYPE = 'payload_type' SENDER = 'sender' RECEIVER = 'receiver' PROTOCOL = 'protocol' KEY = 'key' # WAIT TIME WAIT_TIME = 10 # QUBIT TYPES EPR = 0 DATA = 1 GHZ = 2 # DATA KINDS SIGNAL = 'signal' CLASSICAL = 'classical' QUANTUM = 'quantum' # SIGNALS ACK = 'qunetsim_ACK__' NACK = 'qunetsim_NACK__' # PROTOCOL IDs REC_EPR = 'rec_epr' SEND_EPR = 'send_epr' REC_TELEPORT = 'rec_teleport' SEND_TELEPORT = 'send_teleport' REC_SUPERDENSE = 'rec_superdense' SEND_SUPERDENSE = 'send_superdense' REC_CLASSICAL = 'rec_classical' SEND_CLASSICAL = 'send_classical' SEND_BROADCAST = 'send_broadcast' RELAY = 'relay' SEND_QUBIT = 'send_qubit' REC_QUBIT = 'rec_qubit' SEND_KEY = 'send_key' REC_KEY = 'rec_key' SEND_GHZ = 'send_ghz' REC_GHZ = 'rec_ghz' # MISC QUBITS = 'qubits' HOSTS = 'hosts' KEYSIZE = 'keysize'
#--------------------------------------------------------------------# # Help program. # Created by: Jim - https://www.youtube.com/watch?v=XCgWYx-lGl8 # Changed by: Thiago Piovesan #--------------------------------------------------------------------# # When to use class methods and when to use static methods ? #--------------------------------------------------------------------# class Item: @staticmethod def is_integer(): ''' This should do something that has a relationship with the class, but not something that must be unique per instance! ''' @classmethod def instantiate_from_something(cls): ''' This should also do something that has a relationship with the class, but usually, those are used to manipulate different structures of data to instantiate objects, like we have done with CSV. ''' # THE ONLY DIFFERENCE BETWEEN THOSE: # Static methods are not passing the object reference as the first argument in the background! #--------------------------------------------------------------------# # NOTE: However, those could be also called from instances. item1 = Item() item1.is_integer() item1.instantiate_from_something() #--------------------------------------------------------------------#
FIPS_Reference = { "AL":"01", "AK":"02", "AZ":"04", "AR":"05", "AS":"60", "CA":"06", "CO":"08", "CT":"09", "DE":"10", "FL":"12", "GA":"13", "GU":"66", "HI":"15", "ID":"16", "IL":"17", "IN":"18", "IA":"19", "KS":"20", "KY":"21", "LA":"22", "ME":"23", "MD":"24", "MA":"25", "MI":"26", "MN":"27", "MS":"28", "MO":"29", "MT":"30", "NE":"32", "NV":"32", "NH":"33", "NJ":"34", "NM":"35", "NY":"36", "NC":"37", "ND":"38", "OH":"39", "OK":"40", "OR":"41", "PA":"42", "RI":"44", "PR":"72", "SC":"45", "SD":"46", "TN":"47", "TX":"48", "UT":"49", "VT":"50", "VI":"78", "VA":"51", "WA":"53", "WV":"54", "WI":"55", "WY":"56" }
def check_full_text(fb_full_text, filter_full_text) -> bool: if filter_full_text is None or fb_full_text == filter_full_text: return True return False def check_contains(fb_contains, filter_contains) -> bool: if filter_contains is None: return True intersection = list(fb_contains & filter_contains) if len(intersection) == 0: return False return True def check_payload(fb_payload, filter_payload) -> bool: if filter_payload is None or fb_payload == filter_payload: return True return False
class _Manager(type): """ Singletone for cProfile manager """ _inst = {} def __call__(cls, *args, **kwargs): if cls not in cls._inst: cls._inst[cls] = super(_Manager, cls).__call__(*args, **kwargs) return cls._inst[cls] class ProfileManager(metaclass=_Manager): def __init__(self): self._profiles = list() def clear(self): self._profiles.clear() def add(self, profile): self._profiles.append(profile) def profiles(self): return self._profiles @property def count(self): return len(self._profiles)
class Solution: def maxRotateFunction(self, nums: List[int]) -> int: sums = sum(nums) index = 0 res = 0 for ele in nums: res += index*ele index += 1 ans = res for i in range(1,len(nums)): res = res + sums - (len(nums))*nums[len(nums) - i] ans = max(res,ans) return ans
def is_even(n): return n % 2 == 0 def is_odd(n): return not is_even(n) lost_numbers = (4, 8, 15, 16, 23, 42)
# You are given two non-empty linked lists representing two non-negative integers. # The digits are stored in reverse order and each of their nodes contain a single digit. # Add the two numbers and return it as a linked list. # You may assume the two numbers do not contain any leading zero, except the number 0 itself. # Example: # Input: (2 -> 4 -> 3) + (5 -> 6 -> 4) # Output: 7 -> 0 -> 8 # Explanation: 342 + 465 = 807. # Definition for singly-linked list. class ListNode(object): def __init__(self, x): self.val = x self.next = None class Solution(object): def addTwoNumbers(self,l1,l2): dummy = ListNode(-1) cur = dummy t = 0 while l1 or l2 or t: if l1: t += l1.val l1 = l1.next if l2: t += l2.val l2 = l2.next cur.next = ListNode(t % 10) cur = cur.next t //= 10 return dummy.next
# Given two strings s and t, determine if they are isomorphic. # Two strings s and t are isomorphic if the characters in s can be replaced to # get t. # All occurrences of a character must be replaced with another character while # preserving the order of characters. No two characters may map to the same # character, but a character may map to itself. # Example 1: # Input: s = "egg", t = "add" # Output: true # Example 2: # Input: s = "foo", t = "bar" # Output: false # Example 3: # Input: s = "paper", t = "title" # Output: true # Constraints: # 1 <= s.length <= 5 * 10^4 # t.length == s.length # s and t consist of any valid ascii character. class DictSetSolution: def isIsomorphic(self, s: str, t: str) -> bool: replacements = {} mapped = set() for s_let, t_let in zip(s, t): if (replacement := replacements.get(s_let)): if replacement != t_let: return False else: if t_let in mapped: return False replacements[s_let] = t_let mapped.add(t_let) return True class LengthComparisonSolution: def isIsomorphic(self, s: str, t: str) -> bool: return len(set(zip(s, t))) == len(set(s)) == len(set(t)) class ArraySolution: def isIsomorphic(self, s: str, t: str) -> bool: sa, ta = [0 for i in range(128)], [0 for i in range(128)] for idx, letters in enumerate(zip(s, t)): sl, tl = letters if sa[ord(sl)] != ta[ord(tl)]: return False sa[ord(sl)] = idx + 1 ta[ord(tl)] = idx + 1 return True
def mergeSort(elements): if len(elements) == 0 or len(elements) == 1: # BASE CASE return elements middle = len(elements) // 2 left = mergeSort(elements[:middle]) right = mergeSort(elements[middle:]) if left == [] or right == []: return left or right result = [] i, j = 0, 0 while (len(result) < len(left) + len(right)): if left[i] < right[j]: result.append(left[i]) i+= 1 else: result.append(right[j]) j+= 1 if i == len(left) or j == len(right): result.extend(left[i:] or right[j:]) break return result print(mergeSort([3,4,5,1,2,8,3,7,6]))
__author__ = 'James Myatt' __version__ = '0.0.2' __all__ = [ 'monitor', 'sensor', 'utils', 'time', 'w1therm' ]
class SocketAPIError(Exception): pass class InvalidRequestError(SocketAPIError): pass class InvalidURIError(InvalidRequestError): pass class NotFoundError(InvalidRequestError): pass
# Prints out a string print("Mary had a little lamb.") # Prints out a formatted string print("Its fleece was white as {}.".format('snow')) # Prints out another string print("and everywhere that Mary went.") # Prints a period for ten times print("." * 10) # what'd that do? # Assign a letter to string variable end1 = "C" end2 = "h" end3 = "e" end4 = "e" end5 = "s" end6 = "e" end7 = "B" end8 = "u" end9 = "r" end10 = "g" end11 = "e" end12 = "r" # watch that comma at the end. try removing it to see what happens # end part place a space insetad of a newline print(end1 + end2 + end3 + end4 + end5 + end6, end=' ') print(end7 + end8 + end9 + end10 + end11 + end12)
""" Drones library and API version. """ DRONES_VERSION = "0.1.2"
#!/usr/bin/env python3 # -*- coding: utf-8 -*- class HookitConnectionError(Exception): pass __all__ = ['HookitConnectionError']
def get_gene_ne(global_variables,gene_dictionary): values_list = [] # gets the ordered samples sample_list = global_variables["sample_list"] for sample in sample_list: values_list.append(gene_dictionary[sample]) return values_list
def ceasear_encode( msg, key ): code = "" key = ord(key.upper())-ord("A") for c in msg.upper(): if c in "ABCDEFGHIJKLMNOPQRSTUVWXYZ": new_ord = ord(c)+key if new_ord > ord("Z"): new_ord -= 26 code += chr(new_ord) else: code += c return code def ceasear_decode( code, key ): msg = "" key = ord(key.upper())-ord("A") for c in code.upper(): if c in "ABCDEFGHIJKLMNOPQRSTUVWXYZ": new_ord = ord(c)-key if new_ord < ord("A"): new_ord += 26 msg += chr(new_ord) else: msg += c return msg #print(ceasear_decode(ceasear_encode("HalloWelt", "F"), "F")) msg = """ MRN BRLQNAQNRC NRWNA PNQNRVBLQAROC MJAO WDA EXW MNA PNQNRVQJUCDWP MNB BLQUDNBBNUB JKQJNWPNW, WRLQC SNMXLQ EXW MNA PNQNRVQJUCDWP MNA ENABLQUDNBBNUDWPBVNCQXMN. """ for key in "ABCDEFGHIJKLMNOPQRSTUVWXYZ": #for key in "J": print(key + ": " + ceasear_decode(msg, key)[:14])
def version(): """Function takes no aruguments and returns a STR value of the current version of the library. This value should match the value in the setup.py :param None :return str value of the current version of the library :rtype str >>> version() 1.0.33 """ print ('1.0.34')
""" The main module of DAFEST project. ADAFEST is an abbreviation: 'A Data-Driven Approach to Estimating / Evaluating Software Testability' The full version of source code will be available as soon as the relevant paper(s) are published. """ class Main(): """Welcome to project ADAFEST This file contains the main script """ @classmethod def print_welcome(cls, name) -> None: """ Print welcome message :param name: :return: """ print(f'Welcome to the project {name}.') # Main driver if __name__ == '__main__': Main.print_welcome('ADAFEST')
def sublime(): return [ ('MacOS', 'https://download.sublimetext.com/Sublime%20Text%20Build%203126.dmg', 'sublime/sublime.dmg'), ('Windows (32-bit)', 'https://download.sublimetext.com/Sublime%20Text%20Build%203126%20Setup.exe', 'sublime/sublime-x86.exe'), # noqa ('Windows (64-bit)', 'https://download.sublimetext.com/Sublime%20Text%20Build%203126%20x64%20Setup.exe', 'sublime/sublime-amd64.exe'), # noqa ('Ubuntu (32-bit)', 'https://download.sublimetext.com/sublime-text_build-3126_i386.deb', 'sublime/sublime-x86.deb'), # noqa ('Ubuntu (64-bit)', 'https://download.sublimetext.com/sublime-text_build-3126_amd64.deb', 'sublime/sublime-amd64.deb'), # noqa ]
class PyEVMError(Exception): """ Base class for all py-hvm errors. """ pass class VMNotFound(PyEVMError): """ Raised when no VM is available for the provided block number. """ pass class NoGenesisBlockPresent(PyEVMError): """ Raised when a block is imported but there is no genesis block. """ pass class StateRootNotFound(PyEVMError): """ Raised when the requested state root is not present in our DB. """ pass class HeaderNotFound(PyEVMError): """ Raised when a header with the given number/hash does not exist. """ class BlockNotFound(PyEVMError): """ Raised when the block with the given number/hash does not exist. """ pass class BlockOnWrongChain(PyEVMError): """ Raised when a block interacts with a chain it doesnt belong to """ pass class RewardProofSenderBlockMissing(PyEVMError): """ Raised when a reward block is imported with provided proof from peers, but we don't have an up to date peer chain yet so we cannot verify the proof. Need to safe the block as unprocessed until we download the peer chain. """ pass class NoLocalRootHashTimestamps(PyEVMError): """ Raised when there are no local root hash timestamps """ pass class LocalRootHashNotInConsensus(PyEVMError): """ Raised when there are no local root hash timestamps """ pass class LocalRootHashNotAsExpected(PyEVMError): """ Raised after importing blocks and our root hash doesnt match what it should be """ pass class IncorrectBlockType(PyEVMError): """ Raised when the block is queueblock when it should be block or vice-versa """ pass class IncorrectBlockHeaderType(PyEVMError): """ Raised when the block is queueblock when it should be block or vice-versa """ pass class NotEnoughTimeBetweenBlocks(PyEVMError): """ Raised when there is not enough time between blocks. WHO WOULD HAVE GUESSED? """ pass class CannotCalculateStake(PyEVMError): """ Raised when a function tries to calculate the stake for an address where we are missing information. for example, if we dont have their chain. """ pass class ReceivableTransactionNotFound(PyEVMError): """ Raised when a A receive transaction tries to receive a transaction that wasnt sent """ pass class HistoricalNetworkTPCMissing(PyEVMError): """ Raised when a historical network tpc is missing for a certain timestamp """ pass class NotEnoughProofsOrStakeForRewardType2Proof(PyEVMError): """ Raised when all of the proof we have for a reward type 2 does not meet the minimum requirement """ pass class RewardAmountRoundsToZero(PyEVMError): """ Raised when a node attempts to create a reward block that has amount = 0 for all kinds of rewards. This will occur if not enough time has passed since the last reward. """ pass class NotEnoughDataForHistoricalMinGasPriceCalculation(PyEVMError): """ Raised when there is not enough historical TPC to perform a calculation. Can occur when the genesis node just starts """ pass class HistoricalMinGasPriceError(PyEVMError): """ Raised when a historical network tpc is missing for a certain timestamp """ pass class TransactionNotFound(PyEVMError): """ Raised when the transaction with the given hash or block index does not exist. """ pass class InvalidHeadRootTimestamp(PyEVMError): """ Raised when a timestamp based head hash is loaded or saved with invalid timestamp """ pass class NoChronologicalBlocks(PyEVMError): """ Raised When there are no new blocks within the chronological block windows """ pass class ParentNotFound(HeaderNotFound): """ Raised when the parent of a given block does not exist. """ pass class UnprocessedBlockNotAllowed(PyEVMError): """ Raised when an unprocessed block is imported when it is not allowed """ pass class UnprocessedBlockChildIsProcessed(PyEVMError): """ Raised when a child of an unprocessed block has been processed for some reason """ pass class ReplacingBlocksNotAllowed(PyEVMError): """ Raised when a block tries to replace another block when it is not allowed """ pass class CanonicalHeadNotFound(PyEVMError): """ Raised when the chain has no canonical head. """ pass class TriedImportingGenesisBlock(PyEVMError): """ Raised when the genesis block on the genesis chain is attempted to be overwritten """ pass class TriedDeletingGenesisBlock(PyEVMError): """ Raised when the genesis block on the genesis chain is attempted to be deleted """ pass class CollationHeaderNotFound(PyEVMError): """ Raised when the collation header for the given shard and period does not exist in the database. """ pass class SyncerOutOfOrder(PyEVMError): """ Syncer process has hit a snag and is out of order. For example, regular chain syncer went before it should. """ pass class CollationBodyNotFound(PyEVMError): """ Raised when the collation body for the given shard and period does not exist in the database. """ pass class CanonicalCollationNotFound(PyEVMError): """ Raised when no collation for the given shard and period has been marked as canonical. """ pass class AppendHistoricalRootHashTooOld(PyEVMError): """ Raised when you try to append a historical root hash that is older than the oldest one in our database. can only append newer historical root hashes """ pass class ValidationError(PyEVMError): """ Raised when something does not pass a validation check. """ pass class JournalDbNotActivated(PyEVMError): """ Raised when someone tries to discard, save, persist a db, when it is not actually a journaldb """ pass class Halt(PyEVMError): """ Raised when an opcode function halts vm execution. """ pass class VMError(PyEVMError): """ Base class for errors raised during VM execution. """ burns_gas = True erases_return_data = True class OutOfGas(VMError): """ Raised when a VM execution has run out of gas. """ pass class InsufficientStack(VMError): """ Raised when the stack is empty. """ pass class FullStack(VMError): """ Raised when the stack is full. """ pass class InvalidJumpDestination(VMError): """ Raised when the jump destination for a JUMPDEST operation is invalid. """ pass class InvalidInstruction(VMError): """ Raised when an opcode is invalid. """ pass class InsufficientFunds(VMError): """ Raised when an account has insufficient funds to transfer the requested value. """ pass class ReceiveTransactionIncorrectSenderBlockHash(VMError): """ Raised when a receive transaction is found that has a sender block hash that doesnt match the one in our database. """ pass class ReceivingTransactionForWrongWallet(VMError): """ Raised when a someone tries to receive a transaction sent to someone else. """ pass class StackDepthLimit(VMError): """ Raised when the call stack has exceeded it's maximum allowed depth. """ pass class ContractCreationCollision(VMError): """ Raised when there was an address collision during contract creation. """ pass class IncorrectContractCreationAddress(VMError): """ Raised when the address provided by transaction does not match the calculated contract creation address. """ pass class Revert(VMError): """ Raised when the REVERT opcode occured """ burns_gas = False erases_return_data = False class WriteProtection(VMError): """ Raised when an attempt to modify the state database is made while operating inside of a STATICCALL context. """ pass class OutOfBoundsRead(VMError): """ Raised when an attempt was made to read data beyond the boundaries of the buffer (such as with RETURNDATACOPY) """ pass class AttemptedToAccessExternalStorage(VMError): """ Raised when a contract calls another contract and attempts to use the storage in the other contract. This is not allowed on Helios. Use DelegateCall instead of Call. """ pass class DepreciatedVMFunctionality(VMError): """ Raised when a contract calls another a depreciated global variable or function """ pass
example_data = """\ 1721 979 366 299 675 1456\ """ data = """\ 1914 1931 1892 1584 1546 1988 1494 1709 1624 1755 1849 1430 1890 1675 1604 1580 1500 1277 1729 1456 2002 1075 1512 895 1843 1921 1904 1989 1407 1552 1714 757 1733 1459 1777 1440 1649 1409 1662 1968 1775 1998 1754 1938 1964 1415 1990 1997 1870 1664 1145 1782 1820 1625 1599 1530 1759 1575 1614 1869 1620 1818 1295 1667 1361 1520 1555 1485 1502 1983 1104 1973 1433 1906 1583 1562 1493 1945 1528 1600 1814 1712 1848 1454 1801 1710 1824 1426 1977 1511 1644 1302 1428 1513 1261 1761 1680 1731 1724 1970 907 600 1613 1091 1571 1418 1806 1542 1909 1445 1344 1937 1450 1865 1561 1962 1637 1803 1889 365 1810 1791 1591 1532 1863 1658 1808 1816 1837 1764 1443 1805 1616 1403 1656 1661 1734 1930 1120 1920 1227 1618 1640 1586 1982 1534 1278 1269 1572 1654 1472 1974 1748 1425 1553 1708 1394 1417 1746 1745 1834 1787 1298 1786 1966 1768 1932 1523 1356 1547 1634 1951 1922 222 1461 1628 1888 1639 473 1568 1783 572 1522 1934 1629 1283 1550 1859 2007 1996 1822 996 1911 1689 1537 1793 1762 1677 1266 1715\ """