content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
#!/usr/bin/python def modular_helper(base, exponent, modulus, prefactor=1): c = 1 for k in range(exponent): c = (c * base) % modulus return ((prefactor % modulus) * c) % modulus def fibN(n): phi = (1 + 5 ** 0.5) / 2 return int(phi ** n / 5 ** 0.5 + 0.5) # Alternate problem solutions start...
def modular_helper(base, exponent, modulus, prefactor=1): c = 1 for k in range(exponent): c = c * base % modulus return prefactor % modulus * c % modulus def fib_n(n): phi = (1 + 5 ** 0.5) / 2 return int(phi ** n / 5 ** 0.5 + 0.5) def problem0012a(): p = primes(1000) (n, dn, cnt) =...
class Vector2D: def __init__(self, vec: List[List[int]]): self.v = vec self.row=0 self.col=0 def next(self) -> int: if self.hasNext(): val=self.v[self.row][self.col] self.col+=1 return val else: return ...
class Vector2D: def __init__(self, vec: List[List[int]]): self.v = vec self.row = 0 self.col = 0 def next(self) -> int: if self.hasNext(): val = self.v[self.row][self.col] self.col += 1 return val else: return def has...
# Create a dictionary with the roll number, name and marks # of n students in a class and display the names of students # who have marks above 75. n = int(input("Enter number of students: ")) result = {} for i in range(n): print("Enter Details of student No.", i+1) rno = int(input("Roll No: ")) name = inp...
n = int(input('Enter number of students: ')) result = {} for i in range(n): print('Enter Details of student No.', i + 1) rno = int(input('Roll No: ')) name = input('Name: ') marks = int(input('Marks: ')) result[rno] = [name, marks] for student in result: if result[student][1] > 75: print...
def abs(x: str) -> float: return x if x > 0 else -x # print(abs(10)) # print(abs(-10)) x = set() # print(type(x)) x.add(10) x.add(10) x.add(10) # print(x) # print(len(x)) # print([ord(character) for character in input()]) # print(x.__repr__()) # var = map(int, input().split()) # print(var) n = int(input()) ...
def abs(x: str) -> float: return x if x > 0 else -x x = set() x.add(10) x.add(10) x.add(10) n = int(input()) print(sum((x ** 2 for x in range(1, n + 1))))
first_number = 500 / 100 + 50 + 45 second_number = 250 - 50 print(first_number) print(second_number) total = first_number + second_number print(total)
first_number = 500 / 100 + 50 + 45 second_number = 250 - 50 print(first_number) print(second_number) total = first_number + second_number print(total)
CORE_URL = "https://www.gov.br/receitafederal/pt-br/assuntos/orientacao-tributaria/cadastros/consultas/dados-publicos-cnpj" CORE_URL_FILES = "http://200.152.38.155/CNPJ" CNAE_JSON_NAME = 'cnaes.json' NATJU_JSON_NAME = 'natju.json' QUAL_SOCIO_JSON_NAME = 'qual_socio.json' MOTIVOS_JSON_NAME = 'motivos.json' PAIS_JS...
core_url = 'https://www.gov.br/receitafederal/pt-br/assuntos/orientacao-tributaria/cadastros/consultas/dados-publicos-cnpj' core_url_files = 'http://200.152.38.155/CNPJ' cnae_json_name = 'cnaes.json' natju_json_name = 'natju.json' qual_socio_json_name = 'qual_socio.json' motivos_json_name = 'motivos.json' pais_json_nam...
CLIENT_LOCK_QUEUE_REQUEST_TIME_OUT = 30000 CLIENT_UNLOCK_QUEUE_REQUEST_TIME_OUT = 30000 CLIENT_DEFAULT_DECLARE_QUEUES_REQUEST_TIME_OUT = 30000 CLIENT_DEFAULT_DECLARE_QUEUE_REQUEST_TIME_OUT = 30000 CLIENT_DEFAULT_DECLARE_EXCHANGES_REQUEST_TIME_OUT = 30000 CLIENT_DEFAULT_DECLARE_EXCHANGE_REQUEST_TIME_OUT = 30000 CLIENT_D...
client_lock_queue_request_time_out = 30000 client_unlock_queue_request_time_out = 30000 client_default_declare_queues_request_time_out = 30000 client_default_declare_queue_request_time_out = 30000 client_default_declare_exchanges_request_time_out = 30000 client_default_declare_exchange_request_time_out = 30000 client_d...
# Sometimes methods take arguments. # Try changing the argument passed to lpad. # Then try some whole different methods... catcher = 'Joyce' print(third_batter.lpad(10)) print(third_batter.startswith('M')) print(third_batter.endswith(''))
catcher = 'Joyce' print(third_batter.lpad(10)) print(third_batter.startswith('M')) print(third_batter.endswith(''))
count_shiny_gold_bag = 0 rules = {} with open("input.txt", "r") as f: lines = [line.rstrip() for line in f.readlines()] answered_yes_group = [] for line in lines: line = line.split(" bags contain ") line[1] = line[1].split(",") bags = [] for bag in line[1]: bag ...
count_shiny_gold_bag = 0 rules = {} with open('input.txt', 'r') as f: lines = [line.rstrip() for line in f.readlines()] answered_yes_group = [] for line in lines: line = line.split(' bags contain ') line[1] = line[1].split(',') bags = [] for bag in line[1]: bag = ...
class ParserInterface(): def open(self): pass def get_data(self): pass def close(self): pass
class Parserinterface: def open(self): pass def get_data(self): pass def close(self): pass
# Number of bromine atoms in each species cfc11 = 0 cfc12 = 0 cfc113 = 0 cfc114 = 0 cfc115 = 0 carb_tet = 0 mcf = 0 hcfc22 = 0 hcfc141b = 0 hcfc142b = 0 halon1211 = 1 halon1202 = 2 halon1301 = 1 halon2402 = 2 ch3br = 1 ch3cl = 0 aslist = [cfc11, cfc12, cfc113, cfc114, cfc115, ca...
cfc11 = 0 cfc12 = 0 cfc113 = 0 cfc114 = 0 cfc115 = 0 carb_tet = 0 mcf = 0 hcfc22 = 0 hcfc141b = 0 hcfc142b = 0 halon1211 = 1 halon1202 = 2 halon1301 = 1 halon2402 = 2 ch3br = 1 ch3cl = 0 aslist = [cfc11, cfc12, cfc113, cfc114, cfc115, carb_tet, mcf, hcfc22, hcfc141b, hcfc142b, halon1211, halon1202, halon1301, halon2402...
class S: ASSETS_PATH = "assets/" WINDOW_SIZE = (432, 768) @staticmethod def save_sprite(name, image): name = name.upper() if not hasattr(S, name): setattr(S, name, image) setattr(S, name + "_RECT", image.get_rect())
class S: assets_path = 'assets/' window_size = (432, 768) @staticmethod def save_sprite(name, image): name = name.upper() if not hasattr(S, name): setattr(S, name, image) setattr(S, name + '_RECT', image.get_rect())
#!/usr/bin/env python count = 3 list1 = [] while count > 0: num = int(input(">>> ")) list1.append(num) count -= 1 list1.sort() print(list1)
count = 3 list1 = [] while count > 0: num = int(input('>>> ')) list1.append(num) count -= 1 list1.sort() print(list1)
def Fun(): pass class A: def __init__(self): pass def Fun(self): pass try: print(Fun.__name__) print(A.__init__.__name__) print(A.Fun.__name__) print(A().Fun.__name__) except AttributeError: print('SKIP')
def fun(): pass class A: def __init__(self): pass def fun(self): pass try: print(Fun.__name__) print(A.__init__.__name__) print(A.Fun.__name__) print(a().Fun.__name__) except AttributeError: print('SKIP')
a = input() d = {'A':0,'B':0} for i in range(0,len(a),2): d[a[i]] += int(a[i+1]) if d['A'] > d['B']: print("A") else: print("B")
a = input() d = {'A': 0, 'B': 0} for i in range(0, len(a), 2): d[a[i]] += int(a[i + 1]) if d['A'] > d['B']: print('A') else: print('B')
# -*- coding: utf-8 -*- # this file is released under public domain and you can use without limitations ######################################################################### ## This is a sample controller ## - index is the default action of any application ## - user is required for authentication and authorization...
@auth.requires_membership('admins') def manage_author(): mydb.author.image.represent = lambda image, row: img(_src=url('admin', 'download', args=image), _class='author_image', _width='50px', _onclick='$("#image_container").attr("src","' + url('admin', 'download', args=image) + '");document.getElementById("text_cont...
# Leetcode 94. Binary Tree Inorder Traversal # # Link: https://leetcode.com/problems/binary-tree-inorder-traversal/ # Difficulty: Easy # Complexity: # O(N) time | where N represent the number of nodes in the tree # O(N) space | where N represent the number of nodes in the tree # Definition for a binary tree node. ...
class Solution: def inorder_traversal(self, root: Optional[TreeNode]) -> List[int]: def recursive(root): if not root: return [] return recursive(root.left) + [root.val] + recursive(root.right) def iterative(root): stack = [] result =...
def median(L): L.sort() return L[len(L) // 2] if __name__ == "__main__": L = [10, 17, 25, 1, 4, 15, 6] print(median(L))
def median(L): L.sort() return L[len(L) // 2] if __name__ == '__main__': l = [10, 17, 25, 1, 4, 15, 6] print(median(L))
def greet(bot_name, birth_year): print('Hello! My name is ' + bot_name + '.') print('I was created in ' + birth_year + '.') def remind_name(): print('Please, remind me your name.') name = input() print('What a great name you have, ' + name + '!') def guess_age(): # Remainders are the remains...
def greet(bot_name, birth_year): print('Hello! My name is ' + bot_name + '.') print('I was created in ' + birth_year + '.') def remind_name(): print('Please, remind me your name.') name = input() print('What a great name you have, ' + name + '!') def guess_age(): remainder3 = int(input('Enter ...
self.description = "Install packages with huge descriptions" p1 = pmpkg("pkg1") p1.desc = 'A' * 500 * 1024 self.addpkg(p1) p2 = pmpkg("pkg2") p2.desc = 'A' * 600 * 1024 self.addpkg(p2) self.args = "-U %s %s" % (p1.filename(), p2.filename()) # We error out when fed a package with an invalid description; the second o...
self.description = 'Install packages with huge descriptions' p1 = pmpkg('pkg1') p1.desc = 'A' * 500 * 1024 self.addpkg(p1) p2 = pmpkg('pkg2') p2.desc = 'A' * 600 * 1024 self.addpkg(p2) self.args = '-U %s %s' % (p1.filename(), p2.filename()) self.addrule('PACMAN_RETCODE=1') self.addrule('!PKG_EXIST=pkg1') self.addrule('...
# 99 Days of Code - Sung to the tune of "99 bottles of beer" x = 99 z = 1 while x > 1: y = x - 1 print(x , "days of code to complete,", x, "days of code.") print("Commit to win,then start again", y, "days of code to complete...") print() x = x - 1 if x == 1: print("1 day of code to complete,",...
x = 99 z = 1 while x > 1: y = x - 1 print(x, 'days of code to complete,', x, 'days of code.') print('Commit to win,then start again', y, 'days of code to complete...') print() x = x - 1 if x == 1: print('1 day of code to complete,', '1 day of code') print('It wont be long so finish off stron...
def dist(X, m): S = 0 for x in X: S += abs(x - m) return S T = int(input()) for ti in range(T): N, M, F = map(int, input().split()) X = [] Y = [] for fi in range(F): x, y = map(int, input().split()) X.append(x) Y.append(y) X = sorted(X) Y = sorted(Y) F = 2 if F & 1: xx = str(...
def dist(X, m): s = 0 for x in X: s += abs(x - m) return S t = int(input()) for ti in range(T): (n, m, f) = map(int, input().split()) x = [] y = [] for fi in range(F): (x, y) = map(int, input().split()) X.append(x) Y.append(y) x = sorted(X) y = sorted(...
# When squirrels get together for a party, they like to have acorns. A squirrel party is successful when the number of acorns is between 40 and 60, inclusively. During the weekends, there is no need for acorns. The party is always fun. # input num_acorns = int(input('Enter the number of acorns: ')) is_weekend = input...
num_acorns = int(input('Enter the number of acorns: ')) is_weekend = input('Is it the weekend? (Y/N): ') if is_weekend == 'Y': print('The party was a success.') elif num_acorns >= 40 and num_acorns <= 60: print('The party was a success.') else: print(':(')
# MIN-MAX HACKER EARTH n = int(input()) arr = str(input()) arr = arr.split() arr1 = [] for i in range(0,n,1): x = int(arr[i]) arr1 += [x] min_arr = min(arr1) max_arr = max(arr1) count = 0 for i in range(min_arr+1,max_arr,1): num = i for j in range(0,n,1): if num == arr1[j]: ...
n = int(input()) arr = str(input()) arr = arr.split() arr1 = [] for i in range(0, n, 1): x = int(arr[i]) arr1 += [x] min_arr = min(arr1) max_arr = max(arr1) count = 0 for i in range(min_arr + 1, max_arr, 1): num = i for j in range(0, n, 1): if num == arr1[j]: count = count + 1 ...
del_items(0x800A0FE4) SetType(0x800A0FE4, "void VID_OpenModule__Fv()") del_items(0x800A10A4) SetType(0x800A10A4, "void InitScreens__Fv()") del_items(0x800A1194) SetType(0x800A1194, "void MEM_SetupMem__Fv()") del_items(0x800A11C0) SetType(0x800A11C0, "void SetupWorkRam__Fv()") del_items(0x800A1250) SetType(0x800A1250, "...
del_items(2148143076) set_type(2148143076, 'void VID_OpenModule__Fv()') del_items(2148143268) set_type(2148143268, 'void InitScreens__Fv()') del_items(2148143508) set_type(2148143508, 'void MEM_SetupMem__Fv()') del_items(2148143552) set_type(2148143552, 'void SetupWorkRam__Fv()') del_items(2148143696) set_type(21481436...
def arithmetic_arranger(problems, count_start=False): line_1 = "" line_2 = "" line_3 = "" line_4 = "" for i, problem in enumerate(problems): a, b, c = problem.split() d = max(len(a), len(c)) if len(problems) > 5: return "Error: Too many problems." if le...
def arithmetic_arranger(problems, count_start=False): line_1 = '' line_2 = '' line_3 = '' line_4 = '' for (i, problem) in enumerate(problems): (a, b, c) = problem.split() d = max(len(a), len(c)) if len(problems) > 5: return 'Error: Too many problems.' if l...
# Copyright (c) 2019 The Bazel Utils Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. def runtime_library(): return [ "_WINDOWS", "WIN32", ] def winver(): return [ "_WIN32_WINNT=0x0A00", "WIN...
def runtime_library(): return ['_WINDOWS', 'WIN32'] def winver(): return ['_WIN32_WINNT=0x0A00', 'WINVER=0x0A00'] def unicode(): return ['_UNICODE', 'UNICODE'] def lean_and_mean(): return ['WIN32_LEAN_AND_MEAN']
def arithmetic_arranger(problems, solution=False): # Limit of 4 problems per call if len(problems) > 5: return "Error: Too many problems." # Declaring list to organise problems summa1 = [] summa2 = [] operator = [] # Organising problems in right list for problem in problems: ...
def arithmetic_arranger(problems, solution=False): if len(problems) > 5: return 'Error: Too many problems.' summa1 = [] summa2 = [] operator = [] for problem in problems: prob_list = problem.split() summa1.append(prob_list[0]) summa2.append(prob_list[2]) opera...
''' PURPOSE The function capital_indexes takes a single parameter, which is a string. It returns a list of all the indexes in the string that have capital letters. EXAMPLE Calling capital_indexes("HeLlO") should return the list [0, 2, 4]. ''' def capital_indexes(input_str): try: input_str_len ...
""" PURPOSE The function capital_indexes takes a single parameter, which is a string. It returns a list of all the indexes in the string that have capital letters. EXAMPLE Calling capital_indexes("HeLlO") should return the list [0, 2, 4]. """ def capital_indexes(input_str): try: input_str_len ...
n,m = map(int, input().split()) arr = list(map(int, input().split())) a = set(map(int, input().split())) b = set(map(int,input().split())) print(n,m) print(arr) print(a) print(b) c = 0 for i in arr: if i in a: c = c +1 if i in b: c = c-1 print(c)
(n, m) = map(int, input().split()) arr = list(map(int, input().split())) a = set(map(int, input().split())) b = set(map(int, input().split())) print(n, m) print(arr) print(a) print(b) c = 0 for i in arr: if i in a: c = c + 1 if i in b: c = c - 1 print(c)
# Road to the Mine 1 (931060030) | Xenon 3rd Job lackey = 2159397 gelimer = 2154009 goon = 9300643 sm.lockInGameUI(True) sm.spawnNpc(lackey, 648, 28) # TO DO: Figure out why the lackey doesn't move and just spazes in place (initial start x: 1188) # sm.moveCamera(100, 738, ground) # sm.sendDelay(1000) # sm.moveCamer...
lackey = 2159397 gelimer = 2154009 goon = 9300643 sm.lockInGameUI(True) sm.spawnNpc(lackey, 648, 28) sm.removeEscapeButton() sm.setSpeakerID(lackey) sm.sendNext("Hey, what're you doing out here? And where did that other guy go? You don't look familiar...") sm.setPlayerAsSpeaker() sm.sendSay('I am a Black Wing.') sm.set...
PWR_MGMT_1 = 0x6b ACCEL_CONFIG = 0x1C ACCEL_XOUT_H = 0x3B ACCEL_XOUT_L = 0x3C ACCEL_YOUT_H = 0x3D ACCEL_YOUT_L = 0x3E ACCEL_ZOUT_H = 0x3F ACCEL_ZOUT_L = 0x40 GYRO_CONFIG = 0x1B GYRO_XOUT_H = 0x43 GYRO_XOUT_L = 0x44 GYRO_YOUT_H = 0x45 GYRO_YOUT_L = 0x46 GYRO_ZOUT_H = 0x47 GYRO_ZOUT_L = 0x48 TEMP_H = 0x41 TEMP_L = 0x4...
pwr_mgmt_1 = 107 accel_config = 28 accel_xout_h = 59 accel_xout_l = 60 accel_yout_h = 61 accel_yout_l = 62 accel_zout_h = 63 accel_zout_l = 64 gyro_config = 27 gyro_xout_h = 67 gyro_xout_l = 68 gyro_yout_h = 69 gyro_yout_l = 70 gyro_zout_h = 71 gyro_zout_l = 72 temp_h = 65 temp_l = 66
### ### Week 2: Before Class ### ## Make a list of the words one two three o'clock four o'clock rock words = ["one", "two", "three", "o'clock", "four", "o'clock", 'rock'] ## Pick out the first word as a string words[0] ## Pick out the first word as a list words[0:1] ## Pick out the last word as a string word...
words = ['one', 'two', 'three', "o'clock", 'four', "o'clock", 'rock'] words[0] words[0:1] words[-1] len(words) [len(w) for w in words] words.count("o'clock") print('No output for this')
word1 = input("Enter a word: ") word2 = input("Enter another word: ") word1 = word1.lower() word2 = word2.lower() dic1 = {} dic2 = {} for elm in word1: if elm in dic1.keys(): count = dic1[elm] count += 1 dic1[elm] = count else: dic1[elm] = 1 for elm in word2: if elm in di...
word1 = input('Enter a word: ') word2 = input('Enter another word: ') word1 = word1.lower() word2 = word2.lower() dic1 = {} dic2 = {} for elm in word1: if elm in dic1.keys(): count = dic1[elm] count += 1 dic1[elm] = count else: dic1[elm] = 1 for elm in word2: if elm in dic2.k...
S = input() if S[-2:] == 'ai': print(S[:-2] + 'AI') else: print(S + '-AI')
s = input() if S[-2:] == 'ai': print(S[:-2] + 'AI') else: print(S + '-AI')
def words(digit): for i in digit: num = int(i) if num == 1: print("One") if num == 2: print("Two") if num == 3: print("Three") if num == 4: print("Four") if num == 5: print("Five") if num =...
def words(digit): for i in digit: num = int(i) if num == 1: print('One') if num == 2: print('Two') if num == 3: print('Three') if num == 4: print('Four') if num == 5: print('Five') if num == 6: ...
# Sanitize a dependency so that it works correctly from code that includes # QCraft as a submodule. def clean_dep(dep): return str(Label(dep))
def clean_dep(dep): return str(label(dep))
def unatrag(s): if len(s)==0: return s else: return unatrag(s[1:]) + s[0] s=input("Unesite rijec: ") print(unatrag(s))
def unatrag(s): if len(s) == 0: return s else: return unatrag(s[1:]) + s[0] s = input('Unesite rijec: ') print(unatrag(s))
file_obj = open("squares.txt", "w") #Usar w de writing for number in range (13): square = number * number file_obj.write(str(square)) file_obj.write('\n') file_obj.close()
file_obj = open('squares.txt', 'w') for number in range(13): square = number * number file_obj.write(str(square)) file_obj.write('\n') file_obj.close()
# Exercise 4: Assume that we execute the following assignment statements: # width = 17 # height = 12.0 # For each of the following expressions, write the value of the expression and the type (of the value of the expression). # 1. width//2 # 2. width/2.0 # 3. height/3 # 4. 1 + 2 * 5 width = 17; height = 12.0; one = wi...
width = 17 height = 12.0 one = width // 2 two = width / 2.0 three = height / 3 four = 1 + 2 * 5 print(four, type(four))
altitude = int(input("Enter Altitude in ft:")) if altitude<=1000: print("Safe to land") elif altitude< 5000: print("Bring down to 1000") else: print("Turn Around and Try Again")
altitude = int(input('Enter Altitude in ft:')) if altitude <= 1000: print('Safe to land') elif altitude < 5000: print('Bring down to 1000') else: print('Turn Around and Try Again')
# -*- coding: utf-8 -*- ''' File name: code\comfortable_distance\sol_364.py Author: Vaidic Joshi Date created: Oct 20, 2018 Python Version: 3.x ''' # Solution to Project Euler Problem #364 :: Comfortable distance # # For more information see: # https://projecteuler.net/problem=364 # Problem Statemen...
""" File name: code\\comfortable_distance\\sol_364.py Author: Vaidic Joshi Date created: Oct 20, 2018 Python Version: 3.x """ '\nThere are N seats in a row. N people come after each other to fill the seats according to the following rules:\nIf there is any seat whose adjacent seat(s) are not occupied ta...
class Water(): regions = None outline_points = None def __init__(self): self.regions = [] self.outline_points = []
class Water: regions = None outline_points = None def __init__(self): self.regions = [] self.outline_points = []
1 "test" "equality" == "equality" 1.5 * 10 int
1 'test' 'equality' == 'equality' 1.5 * 10 int
class Classe: atributo_da_classe = 0 print(Classe.atributo_da_classe) Classe.atributo_da_classe = 5 print(Classe.atributo_da_classe)
class Classe: atributo_da_classe = 0 print(Classe.atributo_da_classe) Classe.atributo_da_classe = 5 print(Classe.atributo_da_classe)
# 917. Reverse Only Letters def reverseOnlyLetters(S): def isLetter(c): if (ord(c) >= 65 and ord(c) < 91) or (ord(c) >= 97 and ord(c) < 123): return True return False A = list(S) i, j = 0, len(A) - 1 while i < j: if isLetter(A[i]) and isLetter(A[j]): A[i]...
def reverse_only_letters(S): def is_letter(c): if ord(c) >= 65 and ord(c) < 91 or (ord(c) >= 97 and ord(c) < 123): return True return False a = list(S) (i, j) = (0, len(A) - 1) while i < j: if is_letter(A[i]) and is_letter(A[j]): (A[i], A[j]) = (A[j], A[i...
a=str(input('Enter string')) if(a==a[::-1]): print('palindrome') else: print('not a palindrome')
a = str(input('Enter string')) if a == a[::-1]: print('palindrome') else: print('not a palindrome')
# # PySNMP MIB module CTRON-SSR-SMI-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CTRON-SSR-SMI-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 18:15:44 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Ma...
(integer, object_identifier, octet_string) = mibBuilder.importSymbols('ASN1', 'Integer', 'ObjectIdentifier', 'OctetString') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_union, single_value_constraint, constraints_intersection, value_range_constraint, value_size_constraint) ...
PROCESSOR_VERSION = "0.7.0" # Entities AREAS = "areas" CAMERAS = "cameras" ALL_AREAS = "ALL" # Metrics OCCUPANCY = "occupancy" SOCIAL_DISTANCING = "social-distancing" FACEMASK_USAGE = "facemask-usage" IN_OUT = "in-out" DWELL_TIME = "dwell-time"
processor_version = '0.7.0' areas = 'areas' cameras = 'cameras' all_areas = 'ALL' occupancy = 'occupancy' social_distancing = 'social-distancing' facemask_usage = 'facemask-usage' in_out = 'in-out' dwell_time = 'dwell-time'
''' URL: https://leetcode.com/problems/delete-columns-to-make-sorted/ Difficulty: Easy Description: Delete Columns to Make Sorted We are given an array A of N lowercase letter strings, all of the same length. Now, we may choose any set of deletion indices, and for each string, we delete all the characters in those ...
""" URL: https://leetcode.com/problems/delete-columns-to-make-sorted/ Difficulty: Easy Description: Delete Columns to Make Sorted We are given an array A of N lowercase letter strings, all of the same length. Now, we may choose any set of deletion indices, and for each string, we delete all the characters in those ...
ACTIVE_CLASS = 'active' SELECTED_CLASS = 'selected' class MenuItem: def __init__(self, label, url, css_classes='', submenu=None): self.label = label self.url = url self.css_classes = css_classes self.submenu = submenu def status_class(self, request): css_class = '' ...
active_class = 'active' selected_class = 'selected' class Menuitem: def __init__(self, label, url, css_classes='', submenu=None): self.label = label self.url = url self.css_classes = css_classes self.submenu = submenu def status_class(self, request): css_class = '' ...
class Hyparams: user_count= 192403 item_count= 63001 cate_count= 801 predict_batch_size = 120 predict_ads_num = 100 batch_size = 128 hidden_units = 64 train_batch_size = 32 test_batch_size = 512 predict_batch_size = 32 predict_users_num = 1000 predict_ads_num = 100 ...
class Hyparams: user_count = 192403 item_count = 63001 cate_count = 801 predict_batch_size = 120 predict_ads_num = 100 batch_size = 128 hidden_units = 64 train_batch_size = 32 test_batch_size = 512 predict_batch_size = 32 predict_users_num = 1000 predict_ads_num = 100 ...
''' Created on 1.12.2016 @author: Darren '''''' Follow up for problem "Populating Next Right Pointers in Each Node". What if the given tree could be any binary tree? Would your previous solution still work? Note: You may only use constant extra space. For example, Given the following binary tre...
""" Created on 1.12.2016 @author: Darren Follow up for problem "Populating Next Right Pointers in Each Node". What if the given tree could be any binary tree? Would your previous solution still work? Note: You may only use constant extra space. For example, Given the following binary tree, 1 ...
def set_template(args): # task category args.task = 'VideoBDE' # network parameters args.n_feat = 32 # loss args.loss = '1*L1+2*HEM' # learning rata strategy args.lr = 1e-4 args.lr_decay = 100 args.gamma = 0.1 # data parameters args.data_train = 'SDR4K' args.data_test...
def set_template(args): args.task = 'VideoBDE' args.n_feat = 32 args.loss = '1*L1+2*HEM' args.lr = 0.0001 args.lr_decay = 100 args.gamma = 0.1 args.data_train = 'SDR4K' args.data_test = 'SDR4K' args.n_sequence = 3 args.n_frames_per_video = 100 args.rgb_range = 65535 args....
# # PySNMP MIB module UNCDZ-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/UNCDZ-MIB # Produced by pysmi-0.3.4 at Wed May 1 15:28:43 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...
(octet_string, integer, object_identifier) = mibBuilder.importSymbols('ASN1', 'OctetString', 'Integer', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_intersection, value_size_constraint, single_value_constraint, value_range_constraint, constraints_union) ...
class Settings: def __init__( self, workdir: str, outdir: str, threads: int, debug: bool): self.workdir = workdir self.outdir = outdir self.threads = threads self.debug = debug class Logger: def __i...
class Settings: def __init__(self, workdir: str, outdir: str, threads: int, debug: bool): self.workdir = workdir self.outdir = outdir self.threads = threads self.debug = debug class Logger: def __init__(self, name: str): self.name = name def info(self, msg: str): ...
#import base64 # #data = "abc123!?$*&()'-=@~" # ## Standard Base64 Encoding #encodedBytes = base64.b64encode(data.encode("utf-8")) #encodedStr = str(encodedBytes, "utf-8") # #print(encodedStr) # l = [x for x in range(10)] for x in range(10): l.pop(0) print(l)
l = [x for x in range(10)] for x in range(10): l.pop(0) print(l)
f = open('input.txt') adapters = [] for line in f: adapters.append(int(line[:-1])) adapters.sort() adapters.append(adapters[-1] + 3) differences = {} previous = 0 for adapter in adapters: current_difference = adapter - previous if not current_difference in differences: differences[current_difference] = ...
f = open('input.txt') adapters = [] for line in f: adapters.append(int(line[:-1])) adapters.sort() adapters.append(adapters[-1] + 3) differences = {} previous = 0 for adapter in adapters: current_difference = adapter - previous if not current_difference in differences: differences[current_difference...
# LinkNode/Marker ID Table # -1: Unassigned (Temporary) # 0 ~ 50: Reserved for Joint ID # FRAME_ID = 'viz_frame'
frame_id = 'viz_frame'
''' Statement Given a list of numbers, find and print the elements that appear in it only once. Such elements should be printed in the order in which they occur in the original list. Example input 4 3 5 2 5 1 3 5 Example output 4 2 1 ''' arr = input().split() for i in arr: if arr.count(i) == 1: print(i, ...
""" Statement Given a list of numbers, find and print the elements that appear in it only once. Such elements should be printed in the order in which they occur in the original list. Example input 4 3 5 2 5 1 3 5 Example output 4 2 1 """ arr = input().split() for i in arr: if arr.count(i) == 1: print(i, e...
class Source: pass class URL(Source): def __init__(self, url, method="GET", data=None): self.url = url self.method = method self.data = data def get_data(self, scraper): return scraper.request(method=self.method, url=self.url, data=self.data).content def __str__(self)...
class Source: pass class Url(Source): def __init__(self, url, method='GET', data=None): self.url = url self.method = method self.data = data def get_data(self, scraper): return scraper.request(method=self.method, url=self.url, data=self.data).content def __str__(self)...
fs = 44100. dt = 1. / fs def rawsco_to_ndf(rawsco): clock, rate, nsamps, score = rawsco if rate == 44100: ar = True else: ar = False max_i = score.shape[0] samp = 0 t = 0. # ('apu', ch, func, func_val, natoms, offset) ndf = [ ('clock', int(clock)), ('apu', 'ch', 'p1', 0, 0, 0),...
fs = 44100.0 dt = 1.0 / fs def rawsco_to_ndf(rawsco): (clock, rate, nsamps, score) = rawsco if rate == 44100: ar = True else: ar = False max_i = score.shape[0] samp = 0 t = 0.0 ndf = [('clock', int(clock)), ('apu', 'ch', 'p1', 0, 0, 0), ('apu', 'ch', 'p2', 0, 0, 0), ('apu', ...
#Write a program to input a string and check if it is a palindrome or not. #This solution is in python programing language str = input("Enter the string: ") if str == str[::-1]: print("String is Palindrome") else: print("String is not Palindrome")
str = input('Enter the string: ') if str == str[::-1]: print('String is Palindrome') else: print('String is not Palindrome')
buddy= "extremely loyal and cute" print(len(buddy)) print(buddy[0]) print(buddy[0:10]) print(buddy[0:]) print(buddy[:15]) print(buddy[:]) # len gives you the length or number of characters of the string. # So (len(buddy)) when printed = 24 as even spaces are counted. # [] these brackets help to dissect the components o...
buddy = 'extremely loyal and cute' print(len(buddy)) print(buddy[0]) print(buddy[0:10]) print(buddy[0:]) print(buddy[:15]) print(buddy[:]) print(buddy[-1]) print(buddy[-2]) print(buddy[-5:2])
class Secret: # Dajngo secret key SECRET_KEY = '' # Amazone S3 AWS_STORAGE_BUCKET_NAME = '' AWS_ACCESS_KEY_ID = '' AWS_SECRET_ACCESS_KEY = ''
class Secret: secret_key = '' aws_storage_bucket_name = '' aws_access_key_id = '' aws_secret_access_key = ''
class MessageHandler: def __init__(self, name: str): self.name = name self.broker = None def process_message(self, data: bytes): pass
class Messagehandler: def __init__(self, name: str): self.name = name self.broker = None def process_message(self, data: bytes): pass
self.description = "Sysupgrade with same version, different epochs" sp = pmpkg("dummy", "2:2.0-1") sp.files = ["bin/dummynew"] self.addpkg2db("sync", sp) lp = pmpkg("dummy", "1:2.0-1") lp.files = ["bin/dummyold"] self.addpkg2db("local", lp) self.args = "-Su" self.addrule("PACMAN_RETCODE=0") self.addrule("PKG_VERSIO...
self.description = 'Sysupgrade with same version, different epochs' sp = pmpkg('dummy', '2:2.0-1') sp.files = ['bin/dummynew'] self.addpkg2db('sync', sp) lp = pmpkg('dummy', '1:2.0-1') lp.files = ['bin/dummyold'] self.addpkg2db('local', lp) self.args = '-Su' self.addrule('PACMAN_RETCODE=0') self.addrule('PKG_VERSION=du...
def commonCharacterCount(s1, s2): dic1 = {} dic2 = {} sums = 0 for letter in s1: dic1[letter] = dic1.get(letter,0) + 1 for letter in s2: dic2[letter] = dic2.get(letter,0) + 1 for letter in dic1: if letter in dic2: sums = sums + min(dic1[letter],dic2[letter]) ...
def common_character_count(s1, s2): dic1 = {} dic2 = {} sums = 0 for letter in s1: dic1[letter] = dic1.get(letter, 0) + 1 for letter in s2: dic2[letter] = dic2.get(letter, 0) + 1 for letter in dic1: if letter in dic2: sums = sums + min(dic1[letter], dic2[lette...
class QuickReplyButton: def __init__(self, title: str, payload: str): if not isinstance(title, str): raise TypeError("QuickReplyButton.title must be an instance of str") if not isinstance(payload, str): raise TypeError("QuickReplyButton.payload must be an instance of str") ...
class Quickreplybutton: def __init__(self, title: str, payload: str): if not isinstance(title, str): raise type_error('QuickReplyButton.title must be an instance of str') if not isinstance(payload, str): raise type_error('QuickReplyButton.payload must be an instance of str')...
class EnigmaException(Exception): pass class PlugboardException(EnigmaException): pass class ReflectorException(EnigmaException): pass class RotorException(EnigmaException): pass
class Enigmaexception(Exception): pass class Plugboardexception(EnigmaException): pass class Reflectorexception(EnigmaException): pass class Rotorexception(EnigmaException): pass
def checks_in_string(string, check_list): for check in check_list: if check in string: return True return False
def checks_in_string(string, check_list): for check in check_list: if check in string: return True return False
def find_strongest_eggs(*args): eggs = args[0] div = args[1] res = [] strongest = [] is_strong = True n = div for _ in range(n): res.append([]) for i in range(1): if div == 1: res.append(eggs) break else: for j i...
def find_strongest_eggs(*args): eggs = args[0] div = args[1] res = [] strongest = [] is_strong = True n = div for _ in range(n): res.append([]) for i in range(1): if div == 1: res.append(eggs) break else: for j in range(len(eggs...
##PUT ALL INFO BETWEEN QUOTES BELOW AND RENAME THIS FILE TO 'creds.py' #Twilio API Account info ACCOUNT_SID = "" AUTH_TOKEN = "" # your cell phone number below (must begin with '+', example: "+15555555555") TO_PHONE = "" # your Twilio phone number below (must begin with '+', example: "+15555555555") FROM_PHONE = "" ...
account_sid = '' auth_token = '' to_phone = '' from_phone = '' client_id = ''
class ModeException(Exception): def __init__(self, message: str): super().__init__(message) class SizeException(Exception): def __init__(self, message: str): super().__init__(message) class PaddingException(Exception): def __init__(self, message: str): super().__init__(message) ...
class Modeexception(Exception): def __init__(self, message: str): super().__init__(message) class Sizeexception(Exception): def __init__(self, message: str): super().__init__(message) class Paddingexception(Exception): def __init__(self, message: str): super().__init__(message) ...
def function(a): pass function(10)
def function(a): pass function(10)
class Base1: def __init__(self, *args): print("Base1.__init__",args) class Clist1(Base1, list): pass class Ctuple1(Base1, tuple): pass a = Clist1() print(len(a)) a = Clist1([1, 2, 3]) print(len(a)) a = Ctuple1() print(len(a)) a = Ctuple1([1, 2, 3]) # TODO: Faults #print(len(a)) print("---") cl...
class Base1: def __init__(self, *args): print('Base1.__init__', args) class Clist1(Base1, list): pass class Ctuple1(Base1, tuple): pass a = clist1() print(len(a)) a = clist1([1, 2, 3]) print(len(a)) a = ctuple1() print(len(a)) a = ctuple1([1, 2, 3]) print('---') class Clist2(list, Base1): pa...
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the Li...
_credential_properties = {'blob': {'type': 'string'}, 'project_id': {'type': 'string'}, 'type': {'type': 'string'}, 'user_id': {'type': 'string'}} credential_create = {'type': 'object', 'properties': _credential_properties, 'additionalProperties': True, 'oneOf': [{'title': 'ec2 credential requires project_id', 'require...
def hash_function(s=b''): a, b, c, d = 0xa0, 0xb1, 0x11, 0x4d for byte in bytearray(s): a ^= byte b = b ^ a ^ 0x55 c = b ^ 0x94 d = c ^ byte ^ 0x74 return format(d << 24 | c << 16 | a << 8 | b, '08x')
def hash_function(s=b''): (a, b, c, d) = (160, 177, 17, 77) for byte in bytearray(s): a ^= byte b = b ^ a ^ 85 c = b ^ 148 d = c ^ byte ^ 116 return format(d << 24 | c << 16 | a << 8 | b, '08x')
def buy_card(n: int, p: list): d = [0]*(n+1) for i in range(1, n+1): for j in range(1, i+1): d[i] = max(d[i], d[i-j] + p[j-1]) return d[n] def test_buy_card(): assert buy_card(4, [1, 5, 6, 7]) == 10 assert buy_card(5, [10, 9, 8, 7, 6]) == 50 assert buy_card(10, [1, 1, 2, ...
def buy_card(n: int, p: list): d = [0] * (n + 1) for i in range(1, n + 1): for j in range(1, i + 1): d[i] = max(d[i], d[i - j] + p[j - 1]) return d[n] def test_buy_card(): assert buy_card(4, [1, 5, 6, 7]) == 10 assert buy_card(5, [10, 9, 8, 7, 6]) == 50 assert buy_card(10, [...
class Item: item_id = 1 def __init__(self, name): self.name = name self.item_id = Item.item_id Item.item_id += 1 tv = Item('LG 42') computer = Item('Dell XPS') print(tv.item_id) print(computer.item_id) # prints: # 1 # 2
class Item: item_id = 1 def __init__(self, name): self.name = name self.item_id = Item.item_id Item.item_id += 1 tv = item('LG 42') computer = item('Dell XPS') print(tv.item_id) print(computer.item_id)
# Dit is weer een encoder, dus gebruik instellinen die daarbij horen. real_encoder = tf.keras.models.Sequential([ tf.keras.layers.Dense(784, activation=tf.nn.relu), tf.keras.layers.Dense(128, activation=tf.nn.relu), tf.keras.layers.Dense(2, activation=tf.nn.relu), tf.keras.layers.Dense(128, activation=tf.nn.rel...
real_encoder = tf.keras.models.Sequential([tf.keras.layers.Dense(784, activation=tf.nn.relu), tf.keras.layers.Dense(128, activation=tf.nn.relu), tf.keras.layers.Dense(2, activation=tf.nn.relu), tf.keras.layers.Dense(128, activation=tf.nn.relu), tf.keras.layers.Dense(784, activation=tf.nn.relu)]) real_encoder.compile(lo...
SLOTS = [ [ 0, 5460, ["172.17.0.2", 7000, "cf0da23bbea0ac65fd93d272358b59cd7ce3af25"], ["172.17.0.2", 7003, "ab35b1210fcae1010a463c65e1616b51d3d7a00b"], ], [ 9995, 9995, ["172.17.0.2", 7000, "cf0da23bbea0ac65fd93d272358b59cd7ce3af25"], ["172.17...
slots = [[0, 5460, ['172.17.0.2', 7000, 'cf0da23bbea0ac65fd93d272358b59cd7ce3af25'], ['172.17.0.2', 7003, 'ab35b1210fcae1010a463c65e1616b51d3d7a00b']], [9995, 9995, ['172.17.0.2', 7000, 'cf0da23bbea0ac65fd93d272358b59cd7ce3af25'], ['172.17.0.2', 7003, 'ab35b1210fcae1010a463c65e1616b51d3d7a00b']], [12182, 12182, ['172.1...
def emulate_catchup(replica, ppSeqNo=100): if replica.isMaster: replica.caught_up_till_3pc((replica.viewNo, ppSeqNo)) else: replica.catchup_clear_for_backup() def emulate_select_primaries(replica): replica.primaryName = 'SomeAnotherNode' replica._setup_for_non_master_after_view_change(r...
def emulate_catchup(replica, ppSeqNo=100): if replica.isMaster: replica.caught_up_till_3pc((replica.viewNo, ppSeqNo)) else: replica.catchup_clear_for_backup() def emulate_select_primaries(replica): replica.primaryName = 'SomeAnotherNode' replica._setup_for_non_master_after_view_change(r...
# this is the module which i will be #calling and using again and again def kolar(): print("I am a new module which will work i am call") # this file save with same python path with new file name
def kolar(): print('I am a new module which will work i am call')
f = open('Log-A.strace') lines = f.readlines() term = ' read(' term2 = 'pipe' term3 = 'tty' def extract_name(line, start_delimiter, end_delimiter): name_start = line.find(start_delimiter) name_end = line.find(end_delimiter, name_start + 1) name = line[name_start + 1 : name_end] return name names = [...
f = open('Log-A.strace') lines = f.readlines() term = ' read(' term2 = 'pipe' term3 = 'tty' def extract_name(line, start_delimiter, end_delimiter): name_start = line.find(start_delimiter) name_end = line.find(end_delimiter, name_start + 1) name = line[name_start + 1:name_end] return name names = [] cou...
TEMPLATE_SOURCE_TYPE = "TemplateSourceType" # stairlight.yaml STAIRLIGHT_CONFIG_FILE_PREFIX = "stairlight" STAIRLIGHT_CONFIG_INCLUDE_SECTION = "Include" STAIRLIGHT_CONFIG_EXCLUDE_SECTION = "Exclude" STAIRLIGHT_CONFIG_SETTING_SECTION = "Settings" DEFAULT_TABLE_PREFIX = "DefaultTablePrefix" FILE_SYSTEM_PATH = "FileSyst...
template_source_type = 'TemplateSourceType' stairlight_config_file_prefix = 'stairlight' stairlight_config_include_section = 'Include' stairlight_config_exclude_section = 'Exclude' stairlight_config_setting_section = 'Settings' default_table_prefix = 'DefaultTablePrefix' file_system_path = 'FileSystemPath' regex = 'Reg...
# # @lc app=leetcode id=696 lang=python3 # # [696] Count Binary Substrings # # https://leetcode.com/problems/count-binary-substrings/description/ # # algorithms # Easy (61.31%) # Total Accepted: 81.6K # Total Submissions: 132.8K # Testcase Example: '"00110011"' # # Give a binary string s, return the number of non-e...
class Solution: def count_binary_substrings(self, s: str) -> int: temp = [] current_length = 1 for i in range(1, len(s)): if s[i] != s[i - 1]: temp.append(current_length) current_length = 1 else: current_length += 1 ...
def reverse(s): target = list(s) for i in range(int(len(s) / 2)): swap = target[i] target[i] = target[len(s) - i - 1] target[len(s) - i - 1] = swap return ''.join(target) if __name__ == '__main__': s = 'abcdef' print(reverse(s)) print(s[::-1])
def reverse(s): target = list(s) for i in range(int(len(s) / 2)): swap = target[i] target[i] = target[len(s) - i - 1] target[len(s) - i - 1] = swap return ''.join(target) if __name__ == '__main__': s = 'abcdef' print(reverse(s)) print(s[::-1])
### Build String ### class Solution1: def backspaceCompare(self, S: str, T: str) -> bool: def check(S): S_new = [] for w in S: if w != "#": S_new.append(w) elif len(S_new): S_new.pop() return...
class Solution1: def backspace_compare(self, S: str, T: str) -> bool: def check(S): s_new = [] for w in S: if w != '#': S_new.append(w) elif len(S_new): S_new.pop() return S_new return check...
class DiGraph: def __init__(self): self.nodes = dict() self.edges = [] def copy(self): H_ = __class__() H_.add_edges_from(self.edges) return H_ def __eq__(self, other): return len(set(self.edges) ^ set(other.edges)) == 0 def __str__(self): retu...
class Digraph: def __init__(self): self.nodes = dict() self.edges = [] def copy(self): h_ = __class__() H_.add_edges_from(self.edges) return H_ def __eq__(self, other): return len(set(self.edges) ^ set(other.edges)) == 0 def __str__(self): retu...
''' Problem 34 @author: Kevin Ji ''' FACTORIALS = [1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800] def factorial(number): return FACTORIALS[number] def is_curious_num(number): temp_num = number curious_sum = 0 while temp_num > 0: curious_sum += factorial(temp_num % 10) tem...
""" Problem 34 @author: Kevin Ji """ factorials = [1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800] def factorial(number): return FACTORIALS[number] def is_curious_num(number): temp_num = number curious_sum = 0 while temp_num > 0: curious_sum += factorial(temp_num % 10) temp_nu...
n= int(input("Digite o valor de n: ")) sub = n - 1 fat = n while n != 0: while sub != 1: fat = fat * sub sub = sub -1 print(fat)
n = int(input('Digite o valor de n: ')) sub = n - 1 fat = n while n != 0: while sub != 1: fat = fat * sub sub = sub - 1 print(fat)
class Neuron: # TODO: Create abstraction of generic unsupervised neuron pass
class Neuron: pass
expected_output = { 'switch': { "1": { 'system_temperature_state': 'ok', } } }
expected_output = {'switch': {'1': {'system_temperature_state': 'ok'}}}
# # WAP to accept a number and display all the factors which are prime ( prime factors) user_Inp = int(input("Enter number: ")) for i in range(1, user_Inp+1): c = 0 if(user_Inp % i == 0): for j in range(1, i+1): if(i % j == 0): c += 1 if(c <= 2): print(i, ...
user__inp = int(input('Enter number: ')) for i in range(1, user_Inp + 1): c = 0 if user_Inp % i == 0: for j in range(1, i + 1): if i % j == 0: c += 1 if c <= 2: print(i, end=' ')
N, K = list(map(int, input().split(' '))) cnt = 0 while True: if N == 1: break; if N % K == 0: N /= K else: N -= 1 cnt += 1 print(cnt)
(n, k) = list(map(int, input().split(' '))) cnt = 0 while True: if N == 1: break if N % K == 0: n /= K else: n -= 1 cnt += 1 print(cnt)
class Solution: def nextLargerNodes(self, head: ListNode) -> List[int]: st = [] res = [] while head: while st and st[-1][1] < head.val: idx, v = st.pop() res[idx] = head.val st.append((len(res), head.val)) res.append(0) ...
class Solution: def next_larger_nodes(self, head: ListNode) -> List[int]: st = [] res = [] while head: while st and st[-1][1] < head.val: (idx, v) = st.pop() res[idx] = head.val st.append((len(res), head.val)) res.append(0)...
def find_matches(match_info, results): for target_match_info, obj in results: if target_match_info.equals(match_info): yield target_match_info, obj
def find_matches(match_info, results): for (target_match_info, obj) in results: if target_match_info.equals(match_info): yield (target_match_info, obj)
def test(): print('testing basic math ops') assert 1+1 == 2 assert 10-1 == 9 assert 10 / 2 == 5 assert int(100.9) == 100 print('testing bitwise ops') print(100 ^ 0xd008) assert 100 ^ 0xd008 == 53356 print( 100 & 199 ) assert (100 & 199) == 68 ## TODO fixme print('TODO fix `100 & 199 == 68`') assert 10...
def test(): print('testing basic math ops') assert 1 + 1 == 2 assert 10 - 1 == 9 assert 10 / 2 == 5 assert int(100.9) == 100 print('testing bitwise ops') print(100 ^ 53256) assert 100 ^ 53256 == 53356 print(100 & 199) assert 100 & 199 == 68 print('TODO fix `100 & 199 == 68`')...
phrase = 'Coding For All' phrase = phrase.split() abrv = phrase[0][0] + phrase[1][0] + phrase[2][0] print(abrv)
phrase = 'Coding For All' phrase = phrase.split() abrv = phrase[0][0] + phrase[1][0] + phrase[2][0] print(abrv)