content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
class Solution: def maxProfit(self, prices: List[int]) -> int: if not prices: raise Exception("No Available Prices") low = prices[0] # lowest HISTORICAL price profit = 0 for i in range(1, len(prices)): if prices[i] - low > profit: profit = pr...
class Solution: def max_profit(self, prices: List[int]) -> int: if not prices: raise exception('No Available Prices') low = prices[0] profit = 0 for i in range(1, len(prices)): if prices[i] - low > profit: profit = prices[i] - low ...
# Create a calculator function # The function should accept three parameters: # first_number: a numeric value for the math operation # second_number: a numeric value for the math operation # operation: the word 'add' or 'subtract' # the function should return the result of the two numbers added or subtracted # based on...
def calculator(first_number, second_number, operation): if operation == 'add': answer = first_number + second_number elif operation == 'subtract': answer = first_number - second_number elif operation == 'divide': answer = first_number / second_number return answer first_number = ...
# Auto generated by web.apps.config module WXMP_TOKEN='laonabuzhai' WXMP_APP_ID='wxadf692dbf276c755' WXMP_APP_KEY='d5d70f3c91578b545de3392c8c758dad ' WXMP_ENCODING_AES_KEY='Y81yOIit1k5GZS9Vhx5L1JCOVaQJc9uXnhvaDVKGq4k' WXMP_MSG_ENCRYPT_METHOD='clear'
wxmp_token = 'laonabuzhai' wxmp_app_id = 'wxadf692dbf276c755' wxmp_app_key = 'd5d70f3c91578b545de3392c8c758dad ' wxmp_encoding_aes_key = 'Y81yOIit1k5GZS9Vhx5L1JCOVaQJc9uXnhvaDVKGq4k' wxmp_msg_encrypt_method = 'clear'
# Find this puzzle at: # https://adventofcode.com/2020/day/6 with open('input.txt', 'r') as file: puzzle_input = [i for i in file.read().split('\n\n')] answered = 0 for group in puzzle_input: ques_answered = set() # Add all questions answered to a set. # Duplicates are avoided by using a set. for q...
with open('input.txt', 'r') as file: puzzle_input = [i for i in file.read().split('\n\n')] answered = 0 for group in puzzle_input: ques_answered = set() for question in group.replace('\n', ''): ques_answered.add(question) answered += len(ques_answered) print(answered)
def test_app_is_created(app): assert app.name == 'joalheria.app' def test_config_is_loaded(config): assert config["DEBUG"] is False
def test_app_is_created(app): assert app.name == 'joalheria.app' def test_config_is_loaded(config): assert config['DEBUG'] is False
database = {"shuttle":9080590855,"barath":638383877,"hannah":6987237898} print("\nGreeting\'s from Vigneshwaram") print("Welcome to phoneBook\n") while True: print("Type EDIT to edit the contact number\n CREATE to create a new contact\n SEARCH to search a specific contact\n DELETE to Delete the con...
database = {'shuttle': 9080590855, 'barath': 638383877, 'hannah': 6987237898} print("\nGreeting's from Vigneshwaram") print('Welcome to phoneBook\n') while True: print('Type EDIT to edit the contact number\n CREATE to create a new contact\n SEARCH to search a specific contact\n DELETE to Delete the cont...
#take a user input i = input() print (i) #int i = 23 #float j = 23.5 #bool k = True # char l = 'w' #string m = "word" #input typecasting print("Try to enter an alphabet") value1 = input() value2 = int(value1) print (value2+1) print("Please input integers only") a = int(input()) b = int(input()) #Operator 1 pri...
i = input() print(i) i = 23 j = 23.5 k = True l = 'w' m = 'word' print('Try to enter an alphabet') value1 = input() value2 = int(value1) print(value2 + 1) print('Please input integers only') a = int(input()) b = int(input()) print(a + b) print(a - b) print(a * b) print(a > b) print(a < b) print(a == b) print(a >= b) pr...
def add_native_methods(clazz): def mapAlternativeName__java_io_File__(a0): raise NotImplementedError() clazz.mapAlternativeName__java_io_File__ = staticmethod(mapAlternativeName__java_io_File__)
def add_native_methods(clazz): def map_alternative_name__java_io__file__(a0): raise not_implemented_error() clazz.mapAlternativeName__java_io_File__ = staticmethod(mapAlternativeName__java_io_File__)
class Timings(object): def __init__(self, j): self.raw = j if "blocked" in self.raw: self.blocked = self.raw["blocked"] else: self.blocked = -1 if "dns" in self.raw: self.dns = self.raw["dns"] else: self.dns = -1 if "...
class Timings(object): def __init__(self, j): self.raw = j if 'blocked' in self.raw: self.blocked = self.raw['blocked'] else: self.blocked = -1 if 'dns' in self.raw: self.dns = self.raw['dns'] else: self.dns = -1 if 'co...
def splitscore(file_dir): score = [] Prefix_str = [] f = open(file_dir) for line in f: s =line.split() score.append(float(s[-1])) s = s[0] + ' ' + s[1] + ' ' + s[2] + ' ' Prefix_str.append(s) return score,Prefix_str file_dir1='submission/2019-01-28_15:45:05_fishnet15...
def splitscore(file_dir): score = [] prefix_str = [] f = open(file_dir) for line in f: s = line.split() score.append(float(s[-1])) s = s[0] + ' ' + s[1] + ' ' + s[2] + ' ' Prefix_str.append(s) return (score, Prefix_str) file_dir1 = 'submission/2019-01-28_15:45:05_fish...
layer_info = \ {1: {'B': 1, 'K': 96, 'C': 3, 'OY': 165, 'OX': 165, 'FY': 3, 'FX': 3, 'SY': 2, 'SX': 2, 'SFY': 1, 'SFX': 1, 'PY': 0, 'PX': 0, 'G': 1}, 2: {'B': 1, 'K': 42, 'C': 96, 'OY': 165, 'OX': 165, 'FY': 1, 'FX': 1, 'SY': 1, 'SX': 1, 'SFY': 1, 'SFX': 1, 'PY': 0, 'PX': 0, 'G': 1}, 3: {'B': 1, 'K': 42, 'C': 42, 'O...
layer_info = {1: {'B': 1, 'K': 96, 'C': 3, 'OY': 165, 'OX': 165, 'FY': 3, 'FX': 3, 'SY': 2, 'SX': 2, 'SFY': 1, 'SFX': 1, 'PY': 0, 'PX': 0, 'G': 1}, 2: {'B': 1, 'K': 42, 'C': 96, 'OY': 165, 'OX': 165, 'FY': 1, 'FX': 1, 'SY': 1, 'SX': 1, 'SFY': 1, 'SFX': 1, 'PY': 0, 'PX': 0, 'G': 1}, 3: {'B': 1, 'K': 42, 'C': 42, 'OY': 8...
shelters = ['MNTG1', 'MNTG'] twitter_api_key = 'k5O4owMpAPDcI7LG7y4fue9Fc' twitter_api_secret = 'XXXXX' #Edited out twitter_access_token = '2150117929-qnttvTJW3uvP0QbZr2ZKxaBlrkRPa9FdUUWSxqx' twitter_access_token_secret = 'XXXXX'
shelters = ['MNTG1', 'MNTG'] twitter_api_key = 'k5O4owMpAPDcI7LG7y4fue9Fc' twitter_api_secret = 'XXXXX' twitter_access_token = '2150117929-qnttvTJW3uvP0QbZr2ZKxaBlrkRPa9FdUUWSxqx' twitter_access_token_secret = 'XXXXX'
class LatticeModifier: object = None strength = None vertex_group = None
class Latticemodifier: object = None strength = None vertex_group = None
class ModbusException(Exception): def __init__(self, code): codes = { '1': 'Illegal Function', '2': 'Illegal Data Address', '3': 'Illegal Data Value', '4': 'Slave Device Failure', '5': 'Acknowledge', '6': 'Slave Device Busy', ...
class Modbusexception(Exception): def __init__(self, code): codes = {'1': 'Illegal Function', '2': 'Illegal Data Address', '3': 'Illegal Data Value', '4': 'Slave Device Failure', '5': 'Acknowledge', '6': 'Slave Device Busy', '7': 'Negative Acknowledge', '8': 'Memory Parity Error', '10': 'Gateway Path Unava...
'''2. Write a Python program to convert all units of time into seconds.''' def time_conv(ty, tmo, twk, tdy, thr, tmin): yr = 365 * 24 * 60 * 60 * ty mont = 30 * 24 * 60 * 60 *tmo week = 7 * 24 * 60 * 60 * twk days = 24 * 60 * 60 * tdy hrs= 60*60 * thr mins =60* tmin return f"{ty} year ={...
"""2. Write a Python program to convert all units of time into seconds.""" def time_conv(ty, tmo, twk, tdy, thr, tmin): yr = 365 * 24 * 60 * 60 * ty mont = 30 * 24 * 60 * 60 * tmo week = 7 * 24 * 60 * 60 * twk days = 24 * 60 * 60 * tdy hrs = 60 * 60 * thr mins = 60 * tmin return f'{ty} year...
## Single ended filter chain element # class FilterElement(object): ## Constructor def __init__(self): self.nextelement = None ##! points at next in chain self.name = "noname" ##! nicename for printing ## Call to input data into the filter def input(self, data, meta=None): r...
class Filterelement(object): def __init__(self): self.nextelement = None self.name = 'noname' def input(self, data, meta=None): return self.down.rxup(data, meta) def output(self, data, meta=None): return self.nextelement.input(data, meta) def tick(self): pass ...
class driven_range: def main(self, inputData): inputData.sort() self.inputData = inputData.copy() return self.generateResult() def convertDigitalToAnalog(self, digitalValueRange, ADC_Sensor_Type): # Formula used to convert Digital to Analog: # # Analog_Val...
class Driven_Range: def main(self, inputData): inputData.sort() self.inputData = inputData.copy() return self.generateResult() def convert_digital_to_analog(self, digitalValueRange, ADC_Sensor_Type): analog_value_range = [] (max_digital_value, scale, offset) = self.sens...
# Given 2 arrays, create a function that let's a user know (true/false) whether these two arrays contain any # common items # For Example: # const array1 = ['a', 'b', 'c', 'x'];//const array2 = ['z', 'y', 'i']; # should return false. # ----------- # const array1 = ['a', 'b', 'c', 'x'];//const array2 = ['z', 'y', 'x']; ...
def find_common(list_1, list_2): for i in list1: for j in list2: if i == j: print('Common element is :', i) return True return False list1 = ['a', 'b', 'c', 'x'] list2 = ['z', 'y', 'x'] find_common(list1, list2)
# version_info should conform to PEP 386 # (major, minor, micro, alpha/beta/rc/final, #) # (1, 1, 2, 'alpha', 0) => "1.1.2.dev" # (1, 2, 0, 'beta', 2) => "1.2b2" __version_info__ = (0, 1, 0, 'alpha', 0) def _get_version(): # pragma: no cover " Returns a PEP 386-compliant version number from version_info. " a...
__version_info__ = (0, 1, 0, 'alpha', 0) def _get_version(): """ Returns a PEP 386-compliant version number from version_info. """ assert len(__version_info__) == 5 assert __version_info__[3] in ('alpha', 'beta', 'rc', 'final') parts = 2 if __version_info__[2] == 0 else 3 main = '.'.join(map(str, _...
class Options(object): def __init__(self, dry_run=False, unoptimized=False, verbose=False, debug=False): self.dry_run = dry_run self.unoptimized = unoptimized self.verbose = verbose self.debug = debug
class Options(object): def __init__(self, dry_run=False, unoptimized=False, verbose=False, debug=False): self.dry_run = dry_run self.unoptimized = unoptimized self.verbose = verbose self.debug = debug
# Bubble Sort implementation. def bubbleSort(array): for i in range(len(array) - 1, -1, -1): for j in range(i): if array[j] > array[j+1]: array = exchange(array, j, j+1) print(array) return array # Exchange function implementation. def exchange(array, i, j): te...
def bubble_sort(array): for i in range(len(array) - 1, -1, -1): for j in range(i): if array[j] > array[j + 1]: array = exchange(array, j, j + 1) print(array) return array def exchange(array, i, j): temp = array[i] array[i] = array[j] array[j] = temp r...
words = [word.upper() for word in open('gettysburg.txt').read().split()] theDictionary = {} for word in words: theDictionary[word] = theDictionary.get(word,0) + 1 print(theDictionary)
words = [word.upper() for word in open('gettysburg.txt').read().split()] the_dictionary = {} for word in words: theDictionary[word] = theDictionary.get(word, 0) + 1 print(theDictionary)
class Mobile: def __init__(self, brand, price): print("Inside Constructor") self.brand = brand self.price = price def purchase(self): print("Purchasing a mobile") print("The mobile has brand", self.brand, "and price", self.price) print("Mobile-1") mob1 = Mobile("Apple",...
class Mobile: def __init__(self, brand, price): print('Inside Constructor') self.brand = brand self.price = price def purchase(self): print('Purchasing a mobile') print('The mobile has brand', self.brand, 'and price', self.price) print('Mobile-1') mob1 = mobile('Apple',...
def byte(n): return bytes([n]) def rlp_encode_bytes(x): if len(x) == 1 and x < b'\x80': # For a single byte whose value is in the [0x00, 0x7f] range, # that byte is its own RLP encoding. return x elif len(x) < 56: # Otherwise, if a string is 0-55 bytes long, the RLP encoding # consists of a s...
def byte(n): return bytes([n]) def rlp_encode_bytes(x): if len(x) == 1 and x < b'\x80': return x elif len(x) < 56: return byte(len(x) + 128) + x else: length = to_binary(len(x)) return byte(len(length) + 183) + length + x def rlp_encode_list(xs): sx = b''.join((rlp_...
pm = sm.getChr().getPotentialMan() pm.addPotential(pm.generateRandomPotential(1)) sm.completeQuestNoRewards(12394) sm.dispose()
pm = sm.getChr().getPotentialMan() pm.addPotential(pm.generateRandomPotential(1)) sm.completeQuestNoRewards(12394) sm.dispose()
class UpdateIpExclusionObject: def __init__(self, filterIp, ipFilterId): self.filterIp = filterIp self.ipFilterId = ipFilterId self.memo = None
class Updateipexclusionobject: def __init__(self, filterIp, ipFilterId): self.filterIp = filterIp self.ipFilterId = ipFilterId self.memo = None
class PsKeyCode: def __init__(self): pass def keycode_in_alpha_upper(self, code): return 65 <= code <= 90 def keycode_in_alpha_lower(self, code): return 97 <= code <= 122 def keycode_in_alpha(self, code): return self.keycode_in_alpha_lower( code ) o...
class Pskeycode: def __init__(self): pass def keycode_in_alpha_upper(self, code): return 65 <= code <= 90 def keycode_in_alpha_lower(self, code): return 97 <= code <= 122 def keycode_in_alpha(self, code): return self.keycode_in_alpha_lower(code) or self.keycode_in_alp...
class AnalysisElement: def __init__(self, validationResult, validationMessage): self.validation_result = validationResult self.validation_message = validationMessage class AnalysisResult: def __init__(self): self.elements = [] def add_element(self, element: AnalysisElement): ...
class Analysiselement: def __init__(self, validationResult, validationMessage): self.validation_result = validationResult self.validation_message = validationMessage class Analysisresult: def __init__(self): self.elements = [] def add_element(self, element: AnalysisElement): ...
lim = 10000000 num = [True for _ in range(lim)] for i in range(4, lim, 2): num[i] = False for i in range(3, lim, 2): if num[i]: for j in range(i * i, lim, i): num[j] = False oa = 0 ob = 0 mnp = 0 size = 1000 for a in range(-size + 1, size): for b in range(1, size, 2): np =...
lim = 10000000 num = [True for _ in range(lim)] for i in range(4, lim, 2): num[i] = False for i in range(3, lim, 2): if num[i]: for j in range(i * i, lim, i): num[j] = False oa = 0 ob = 0 mnp = 0 size = 1000 for a in range(-size + 1, size): for b in range(1, size, 2): np = 0 ...
STATS = [ { "num_node_expansions": 0, "search_time": 0.0260686, "total_time": 0.161712, "plan_length": 64, "plan_cost": 64, "objects_used": 261, "objects_total": 379, "neural_net_time": 0.10646533966064453, "num_replanning_steps": 3, "w...
stats = [{'num_node_expansions': 0, 'search_time': 0.0260686, 'total_time': 0.161712, 'plan_length': 64, 'plan_cost': 64, 'objects_used': 261, 'objects_total': 379, 'neural_net_time': 0.10646533966064453, 'num_replanning_steps': 3, 'wall_time': 2.435692071914673}, {'num_node_expansions': 0, 'search_time': 0.0279492, 't...
# Numbers are not stored in the written representation, so they can't be # treated like strings. a = 123 print(a[1])
a = 123 print(a[1])
def get_reversed_string(word): return word[::-1] while True: string = input() if string == 'end': break rev_str = get_reversed_string(string) print(f'{string} = {rev_str}')
def get_reversed_string(word): return word[::-1] while True: string = input() if string == 'end': break rev_str = get_reversed_string(string) print(f'{string} = {rev_str}')
# Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution: def levelOrderBottom(self, root: 'TreeNode') -> 'List[List[int]]': if not root: return stack = [(ro...
class Solution: def level_order_bottom(self, root: 'TreeNode') -> 'List[List[int]]': if not root: return stack = [(root, 0)] rst = [] while stack: (n, level) = stack.pop(0) if len(rst) < level + 1: rst.insert(0, []) rst...
# def function_name_print(a,b,c,d): # # print(a,b,c,d) def funargs(normal,*args, **kwargs): print(normal) for item in args: print(item) print("\nNow I would like to introduce some of our heroes") for key,value in kwargs.items(): print(f"{key} is a {value}") # As a tu...
def funargs(normal, *args, **kwargs): print(normal) for item in args: print(item) print('\nNow I would like to introduce some of our heroes') for (key, value) in kwargs.items(): print(f'{key} is a {value}') list = ['Jiggu', 'g', 'f', 'dd'] normal = 'Yhis is normal' kw = {'Rohan': 'Monito...
class MonoDevelopSvnPackage (Package): def __init__ (self): Package.__init__ (self, 'monodevelop', 'trunk') def svn_co_or_up (self): self.cd ('..') if os.path.isdir ('svn'): self.cd ('svn') self.sh ('svn up') else: self.sh ('svn co http://anonsvn.mono-project.com/source/trunk/monodevelop svn') se...
class Monodevelopsvnpackage(Package): def __init__(self): Package.__init__(self, 'monodevelop', 'trunk') def svn_co_or_up(self): self.cd('..') if os.path.isdir('svn'): self.cd('svn') self.sh('svn up') else: self.sh('svn co http://anonsvn.mono...
# # PySNMP MIB module CISCOSB-UDP (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCOSB-UDP # Produced by pysmi-0.3.4 at Wed May 1 12:24:02 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, 0...
(integer, octet_string, object_identifier) = mibBuilder.importSymbols('ASN1', 'Integer', 'OctetString', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (single_value_constraint, value_range_constraint, constraints_intersection, value_size_constraint, constraints_union) ...
def entry_id(entry): for field in ['id', 'link']: ret = getattr(entry, field, None) if ret: return ret raise Exception('no id field found in entry: {}'.format(entry))
def entry_id(entry): for field in ['id', 'link']: ret = getattr(entry, field, None) if ret: return ret raise exception('no id field found in entry: {}'.format(entry))
print("~" * 60) print("Tower of Hanoi") def hanoi(n, src, dst, tmp): if n > 0: hanoi(n - 1, src, tmp, dst) print(f"Move disk {n} from {src} to {dst}") hanoi(n - 1, tmp, dst, src) hanoi(4, "A", "B", "C") print("~" * 60) print("8 Queens Problem") queen = [0 for _ in range(8)] rfree = [Tr...
print('~' * 60) print('Tower of Hanoi') def hanoi(n, src, dst, tmp): if n > 0: hanoi(n - 1, src, tmp, dst) print(f'Move disk {n} from {src} to {dst}') hanoi(n - 1, tmp, dst, src) hanoi(4, 'A', 'B', 'C') print('~' * 60) print('8 Queens Problem') queen = [0 for _ in range(8)] rfree = [True fo...
class Function: def __init__(self, name, param_types, return_type, line=0): self.name = name self.param_types = param_types self.return_type = return_type self.line = line def __str__(self): return Function.__qualname__ def getattr(self, name): raise Attrib...
class Function: def __init__(self, name, param_types, return_type, line=0): self.name = name self.param_types = param_types self.return_type = return_type self.line = line def __str__(self): return Function.__qualname__ def getattr(self, name): raise attrib...
class Solution: def minStartValue(self, nums: List[int]) -> int: total = minSum = 0 for num in nums: total += num minSum = min(minSum, total) return 1 - minSum
class Solution: def min_start_value(self, nums: List[int]) -> int: total = min_sum = 0 for num in nums: total += num min_sum = min(minSum, total) return 1 - minSum
def conduit_login(driver): driver.find_element_by_xpath('//a[@href="#/login"]').click() driver.find_element_by_xpath('//input[@placeholder="Email"]').send_keys("testmail61@test.hu") driver.find_element_by_xpath('//input[@placeholder="Password"]').send_keys("Testpass1") driver.find_element_by_xpath('//*[...
def conduit_login(driver): driver.find_element_by_xpath('//a[@href="#/login"]').click() driver.find_element_by_xpath('//input[@placeholder="Email"]').send_keys('testmail61@test.hu') driver.find_element_by_xpath('//input[@placeholder="Password"]').send_keys('Testpass1') driver.find_element_by_xpath('//*[...
class Node(): def __init__(self, val): self.val = val self.adjacent_nodes = [] self.visited = False # O(E^d) where d is depth def word_transform(w1, w2, dictionary): # make dictionary into linked list start_node = Node(w1) end_node = Node(w2) nodes = [start_node, end_node] ...
class Node: def __init__(self, val): self.val = val self.adjacent_nodes = [] self.visited = False def word_transform(w1, w2, dictionary): start_node = node(w1) end_node = node(w2) nodes = [start_node, end_node] nodes_dict = {start_node.val: start_node, end_node.val: end_nod...
# leetcode class Solution: def mincostTickets(self, days: List[int], costs: List[int]) -> int: num = 366 one, seven, thirty = costs dp = [0] * num idx = 0 for i in range(1, num): dp[i] = dp[i-1] if i == days[idx]: ...
class Solution: def mincost_tickets(self, days: List[int], costs: List[int]) -> int: num = 366 (one, seven, thirty) = costs dp = [0] * num idx = 0 for i in range(1, num): dp[i] = dp[i - 1] if i == days[idx]: dp[i] = min(one + dp[i - 1 ...
''' The Python repository "AA" contains the scripts, data, figures, and text for nudged Arctic Amplification (AA) and Upper-troposphere Tropical Warming (UTW). The model is SC-WACCM4. We are interested in the large-scale atmospheric response to Arctic sea ice loss in AA simulations compared to sea-ice forcing. See Pe...
""" The Python repository "AA" contains the scripts, data, figures, and text for nudged Arctic Amplification (AA) and Upper-troposphere Tropical Warming (UTW). The model is SC-WACCM4. We are interested in the large-scale atmospheric response to Arctic sea ice loss in AA simulations compared to sea-ice forcing. See Pe...
# employees = {'marge': 3, 'mag': 2} # employees['phil'] = '5' # print(employees.values()) # new_list = list(iter(employees)) # for key, value in employees.iteritems(): # print(key,value) # print(new_list) # t = ('a', 'b', 'c', 'd') # print(t.index('c')) # print(1 > 2) # myfile = open('test_file.txt') # read =...
f = open('second_file.txt') lines = f.read() print(lines)
sample_pos_100_circle = { (0, 12, 14, 28, 61, 76) : (0.6606687940575429, 0.12955294286970329, 0.1392231402857147), (0, 14, 26, 28, 61, 76) : (0.6775622847685568, 0.0898623709846611, 0.14956067316950022), (0, 11, 12, 14, 23, 28, 42, 44, 76, 79, 89) : (0.6065886283561139, 0.20320288122581232, 0.140052078713...
sample_pos_100_circle = {(0, 12, 14, 28, 61, 76): (0.6606687940575429, 0.12955294286970329, 0.1392231402857147), (0, 14, 26, 28, 61, 76): (0.6775622847685568, 0.0898623709846611, 0.14956067316950022), (0, 11, 12, 14, 23, 28, 42, 44, 76, 79, 89): (0.6065886283561139, 0.20320288122581232, 0.14005207871339437), (0, 11, 12...
# -*- coding: utf-8 -*- '''Top-level package for lico.''' __author__ = '''Sjoerd Kerkstra''' __email__ = 'w.s.kerkstra@example.com' __version__ = '0.1.1'
"""Top-level package for lico.""" __author__ = 'Sjoerd Kerkstra' __email__ = 'w.s.kerkstra@example.com' __version__ = '0.1.1'
# Author: zhao-zh10 # ----------- # User Instructions: # # Modify the the search function so that it becomes # an A* search algorithm as defined in the previous # lectures. # # Your function should return the expanded grid # which shows, for each element, the count when # it was expanded or -1 if the element was never ...
grid = [[0, 1, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0]] heuristic = [[9, 8, 7, 6, 5, 4], [8, 7, 6, 5, 4, 3], [7, 6, 5, 4, 3, 2], [6, 5, 4, 3, 2, 1], [5, 4, 3, 2, 1, 0]] init = [0, 0] goal = [len(grid) - 1, len(grid[0]) - 1] cost = 1 delta = [[-1, 0], [0, -1], [1, 0], ...
# python3 class HeapBuilder: def __init__(self): self._swaps = [] self._data = [] def ReadData(self): global n n = int(input()) self._data = [int(s) for s in input().split()] assert n == len(self._data) def WriteResponse(self): print(len(self._swaps)) for swap in self._...
class Heapbuilder: def __init__(self): self._swaps = [] self._data = [] def read_data(self): global n n = int(input()) self._data = [int(s) for s in input().split()] assert n == len(self._data) def write_response(self): print(len(self._swaps)) ...
# python dict of naming overrides GENE_NAME_OVERRIDE = { # pmmo Genes 'EQU24_RS19315':'pmoC', 'EQU24_RS19310':'pmoA', 'EQU24_RS19305':'pmoB', # smmo Genes 'EQU24_RS05930':'mmoR', 'EQU24_RS05925':'mmoG', 'EQU24_RS05910':'mmoC', 'EQU24_RS05900':'mmoZ', 'EQU24_RS05895':'mmoB', 'EQU24_RS05890':'mmoY', 'EQU24...
gene_name_override = {'EQU24_RS19315': 'pmoC', 'EQU24_RS19310': 'pmoA', 'EQU24_RS19305': 'pmoB', 'EQU24_RS05930': 'mmoR', 'EQU24_RS05925': 'mmoG', 'EQU24_RS05910': 'mmoC', 'EQU24_RS05900': 'mmoZ', 'EQU24_RS05895': 'mmoB', 'EQU24_RS05890': 'mmoY', 'EQU24_RS05885': 'mmoX', 'EQU24_RS17825': 'groS', 'EQU24_RS08650': 'groS'...
class Coordinate: coordX = 0 coordY = 0 def __init__(self, coordX=0, coordY=0): self.coordX = coordX self.coordY = coordY pass def set(self, coordX, coordY): self.coordX = coordX self.coordY = coordY return coordX, coordY if __name__ == '_...
class Coordinate: coord_x = 0 coord_y = 0 def __init__(self, coordX=0, coordY=0): self.coordX = coordX self.coordY = coordY pass def set(self, coordX, coordY): self.coordX = coordX self.coordY = coordY return (coordX, coordY) if __name__ == '__main__': ...
apiAttachAvailable = u'API Kullanilabilir' apiAttachNotAvailable = u'Kullanilamiyor' apiAttachPendingAuthorization = u'Yetkilendirme Bekliyor' apiAttachRefused = u'Reddedildi' apiAttachSuccess = u'Basarili oldu' apiAttachUnknown = u'Bilinmiyor' budDeletedFriend = u'Arkadas Listesinden Silindi' budFriend = u'Arkadas' bu...
api_attach_available = u'API Kullanilabilir' api_attach_not_available = u'Kullanilamiyor' api_attach_pending_authorization = u'Yetkilendirme Bekliyor' api_attach_refused = u'Reddedildi' api_attach_success = u'Basarili oldu' api_attach_unknown = u'Bilinmiyor' bud_deleted_friend = u'Arkadas Listesinden Silindi' bud_frien...
# Copyright (C) 2015-2016 Ammon Smith and Bradley Cai # Available for use under the terms of the MIT License. __all__ = [ 'print_success', 'print_failure', ] def print_success(target, usecolor, elapsed): if usecolor: start_color = '\033[32;4m' end_color = '\033[0m' else: start...
__all__ = ['print_success', 'print_failure'] def print_success(target, usecolor, elapsed): if usecolor: start_color = '\x1b[32;4m' end_color = '\x1b[0m' else: start_color = '' end_color = '' print("%sTarget '%s' ran successfully in %.4f seconds.%s" % (start_color, target, el...
# # PySNMP MIB module IANA-GMPLS-TC-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/IANA-GMPLS-TC-MIB # Produced by pysmi-0.3.4 at Wed May 1 13:19:44 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Ma...
(octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_size_constraint, single_value_constraint, constraints_union, constraints_intersection, value_range_constraint) ...
letters = ["a", "e", "t", "o", "u"] word = "CreepyNuts" if (word[1] in letters) and (word[6] in letters): print(0) elif (word[1] in letters) or (word[6] in letters): print(1) else: print(2)
letters = ['a', 'e', 't', 'o', 'u'] word = 'CreepyNuts' if word[1] in letters and word[6] in letters: print(0) elif word[1] in letters or word[6] in letters: print(1) else: print(2)
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2017 - hongzhi.wang <hongzhi.wang@moji.com> ''' Author: hongzhi.wang Create Date: 2019-09-04 Modify Date: 2019-09-04 '''
""" Author: hongzhi.wang Create Date: 2019-09-04 Modify Date: 2019-09-04 """
def parse_input(file): return [[int(h) for h in l] for l in open(file).read().splitlines()] input = parse_input('./day 09/Xavier - Python/input.txt') example = parse_input('./day 09/Xavier - Python/example.txt') def get_neighbours(map,i,j): neighbours = [] if i > 0: neighbours.append((i-1,j)) ...
def parse_input(file): return [[int(h) for h in l] for l in open(file).read().splitlines()] input = parse_input('./day 09/Xavier - Python/input.txt') example = parse_input('./day 09/Xavier - Python/example.txt') def get_neighbours(map, i, j): neighbours = [] if i > 0: neighbours.append((i - 1, j)) ...
_base_ = ['./mask_rcnn_r50_8x2_1x.py'] model = dict(roi_head=dict(type='BTRoIHead', bbox_head=dict(type='Shared2FCCBBoxHeadBT', loss_cls=dict(type="EQLv2"), loss_opl=dict( ...
_base_ = ['./mask_rcnn_r50_8x2_1x.py'] model = dict(roi_head=dict(type='BTRoIHead', bbox_head=dict(type='Shared2FCCBBoxHeadBT', loss_cls=dict(type='EQLv2'), loss_opl=dict(type='OrthogonalProjectionLoss', loss_weight=0.0), loss_bt=dict(type='BarlowTwinLoss', loss_weight=1.0)))) data = dict(train=dict(oversample_thr=0.00...
# -*- coding: utf-8 -*- # System SYSTEM_LANGUAGE_KEY = 'System/Language' SYSTEM_THEME_KEY = 'System/Theme' SYSTEM_THEME_DEFAULT = 'System' # File FILE_SAVE_TO_DIR_KEY = 'File/SaveToDir' FILE_SAVE_TO_DIR_DEFAULT = '' FILE_FILENAME_PREFIX_FORMAT_KEY = 'File/FilenamePrefixFormat' FILE_FILENAME_PREFIX_FORMAT_DEFAULT = ...
system_language_key = 'System/Language' system_theme_key = 'System/Theme' system_theme_default = 'System' file_save_to_dir_key = 'File/SaveToDir' file_save_to_dir_default = '' file_filename_prefix_format_key = 'File/FilenamePrefixFormat' file_filename_prefix_format_default = '{id}_{year}_{author}_{title}' file_overwrit...
#Get roll numbers, name & marks of the students of a class(get from user) and store these details in a file- marks.txt count = int(input("How many students are there in class? ")) fileObj = open('marks.txt',"w") for i in range(count): print("Enter details for student",(i+1),"below:") rollNo = int(input("Rolln...
count = int(input('How many students are there in class? ')) file_obj = open('marks.txt', 'w') for i in range(count): print('Enter details for student', i + 1, 'below:') roll_no = int(input('Rollno: ')) name = input('Name: ') marks = float(input('Marks: ')) records = str(rollNo) + ',' + name + ',' +...
# id: 640;Stairs # title:"Schody", # about:"", # robotCol:3, # robotRow:10, # robotDir:3, # subs:[3,3,0,0,0], # allowedCommands:0, # board:" ggggggggGG gggggggGGg ggggggGGgg gggggGGggg ggggGGgggg gggGGggggg ggGGgggggg gGGggggggg GGgggggggg gggggggggg ...
class Problem: def __init__(self, parse_str): gen = self.__lineGenerator(parse_str) self.id = next(gen) self.title = next(gen) self.about = next(gen) self.robotCol = int(next(gen)) self.robotRow = int(next(gen)) self.robotDir = int(next(gen)) self.sub...
class DSU: def __init__(self, N): self.par = list(range(N)) def find(self, U): if self.par[U] != U: self.par[U] = self.find(self.par[U]) return self.par[U] def union(self, U, V): X, Y = self.find(U), self.find(V) self.par[X] = Y class Solution: def...
class Dsu: def __init__(self, N): self.par = list(range(N)) def find(self, U): if self.par[U] != U: self.par[U] = self.find(self.par[U]) return self.par[U] def union(self, U, V): (x, y) = (self.find(U), self.find(V)) self.par[X] = Y class Solution: ...
#!/usr/bin/python # -*- coding: utf-8 -*- # simple dictionary mybasket = {'apple':2.99,'orange':1.99,'milk':5.8} print(mybasket['apple']) # dictionary with list inside mynestedbasket = {'apple':2.99,'orange':1.99,'milk':['chocolate','stawbery']} print(mynestedbasket['milk'][1].upper()) # append more key myba...
mybasket = {'apple': 2.99, 'orange': 1.99, 'milk': 5.8} print(mybasket['apple']) mynestedbasket = {'apple': 2.99, 'orange': 1.99, 'milk': ['chocolate', 'stawbery']} print(mynestedbasket['milk'][1].upper()) mybasket['pizza'] = 4.5 print(mybasket) print(mybasket.keys()) print(mybasket.values()) print(mybasket.items())
class Solution: def islandPerimeter(self, grid: List[List[int]]) -> int: if not grid or not grid[0]: return 0 for i in range(len(grid)): for j in range(len(grid[0])): if grid[i][j]: return self.dfs(grid, i, j) return 0 def dfs...
class Solution: def island_perimeter(self, grid: List[List[int]]) -> int: if not grid or not grid[0]: return 0 for i in range(len(grid)): for j in range(len(grid[0])): if grid[i][j]: return self.dfs(grid, i, j) return 0 def df...
class Solution: def addBinary(self, a, b): res, carry = '', 0 i, j = len(a) - 1, len(b) - 1 while i >= 0 or j >= 0 or carry: curval = (i >= 0 and a[i] == '1') + (j >= 0 and b[j] == '1') carry, rem = divmod(curval + carry, 2) res = str(rem) + res ...
class Solution: def add_binary(self, a, b): (res, carry) = ('', 0) (i, j) = (len(a) - 1, len(b) - 1) while i >= 0 or j >= 0 or carry: curval = (i >= 0 and a[i] == '1') + (j >= 0 and b[j] == '1') (carry, rem) = divmod(curval + carry, 2) res = str(rem) + re...
#this function would write data in the database def write_data(name, phone, pincode, city, resources): #here we will connect to database #and write to it f = open('/Users/mukesht/Mukesh/Github/covid_resource/resource_item.text', 'a') f.write(name + ', ' + phone + ', ' + pincode + ', ' + city + ', [' + resource...
def write_data(name, phone, pincode, city, resources): f = open('/Users/mukesht/Mukesh/Github/covid_resource/resource_item.text', 'a') f.write(name + ', ' + phone + ', ' + pincode + ', ' + city + ', [' + resources + ']\n') f.close() write_data('Hello World', '657254762', '232101', 'Mughalsarai', '[ Oxygen, ...
def validate(n): string = str(n) mod = 0 if len(string) % 2 == 0 else 1 # 0 for even, 1 for odd total = 0 for i, a in enumerate(string): current = int(a) if i % 2 == mod: double = current * 2 if double > 9: total += double - 9 else: ...
def validate(n): string = str(n) mod = 0 if len(string) % 2 == 0 else 1 total = 0 for (i, a) in enumerate(string): current = int(a) if i % 2 == mod: double = current * 2 if double > 9: total += double - 9 else: total += ...
expected_output = { "interfaces": { "Port-channel1": { "name": "Port-channel1", "protocol": "lacp", "members": { "GigabitEthernet0/0/1": { "activity": "Active", "age": 18, "aggregatable": True, ...
expected_output = {'interfaces': {'Port-channel1': {'name': 'Port-channel1', 'protocol': 'lacp', 'members': {'GigabitEthernet0/0/1': {'activity': 'Active', 'age': 18, 'aggregatable': True, 'collecting': True, 'defaulted': False, 'distributing': True, 'expired': False, 'flags': 'FA', 'interface': 'GigabitEthernet0/0/1',...
#!/usr/bin/python # -*- coding: utf-8 -*- inputs = [ "LLLRLLULLDDLDUDRDDURLDDRDLRDDRUULRULLLDLUURUUUDLUUDLRUDLDUDURRLDRRRUULUURLUDRURULRLRLRRUULRUUUDRRDDRLLLDDLLUDDDLLRLLULULRRURRRLDRLDLLRURDULLDULRUURLRUDRURLRRDLLDDURLDDLUDLRLUURDRDRDDUURDDLDDDRUDULDLRDRDDURDLUDDDRUDLUDLULULRUURLRUUUDDRLDULLLUDLULDUUDLDLRRLLLRLDUDRUU...
inputs = ['LLLRLLULLDDLDUDRDDURLDDRDLRDDRUULRULLLDLUURUUUDLUUDLRUDLDUDURRLDRRRUULUURLUDRURULRLRLRRUULRUUUDRRDDRLLLDDLLUDDDLLRLLULULRRURRRLDRLDLLRURDULLDULRUURLRUDRURLRRDLLDDURLDDLUDLRLUURDRDRDDUURDDLDDDRUDULDLRDRDDURDLUDDDRUDLUDLULULRUURLRUUUDDRLDULLLUDLULDUUDLDLRRLLLRLDUDRUULDLDRDLRRDLDLULUUDRRUDDDRDLRLDLRDUDRULDRDURR...
#!/usr/bin/env python3 def num_sol(n): if n==1: return 1 if n==2: return 2 solu=num_sol(n-1)+num_sol(n-2) return solu # def unrank(n, pos, sorting_criterion="loves_long_tiles"): # return "(" + unrank(n_in_A, (pos-count) // num_B) + ")" + unrank(n - n_in_A -1, (pos-count) % num...
def num_sol(n): if n == 1: return 1 if n == 2: return 2 solu = num_sol(n - 1) + num_sol(n - 2) return solu def unrank(n): if num_sol(n) == 1: return ['[]'] if num_sol(n) == 2: return ['[][]', '[--]'] solu1 = [] solu2 = [] for i in range(num_sol(n - 1)...
def check_geneassessment(result, payload, previous_assessment_id=None): assert result["gene_id"] == payload["gene_id"] assert result["evaluation"] == payload["evaluation"] assert result["analysis_id"] == payload.get("analysis_id") assert result["genepanel_name"] == payload["genepanel_name"] assert r...
def check_geneassessment(result, payload, previous_assessment_id=None): assert result['gene_id'] == payload['gene_id'] assert result['evaluation'] == payload['evaluation'] assert result['analysis_id'] == payload.get('analysis_id') assert result['genepanel_name'] == payload['genepanel_name'] assert r...
class Edge: def __init__(self, start, end): self.start = start self.end = end def __str__(self): return "<" + str(self.start) + " " + str(self.end) + ">"
class Edge: def __init__(self, start, end): self.start = start self.end = end def __str__(self): return '<' + str(self.start) + ' ' + str(self.end) + '>'
class Solution: def minOperations(self, boxes: str) -> List[int]: ans = [0]*len(boxes) lc = 0 lcost = 0 rc = 0 rcost = 0 for i in range(1,len(boxes)): if boxes[i-1]=="1": lc+=1 lcost += lc ans[i] = lcost for i in range(len(...
class Solution: def min_operations(self, boxes: str) -> List[int]: ans = [0] * len(boxes) lc = 0 lcost = 0 rc = 0 rcost = 0 for i in range(1, len(boxes)): if boxes[i - 1] == '1': lc += 1 lcost += lc ans[i] = lcost ...
class Solution: def evalRPN(self, tokens: List[str]) -> int: stack = [] op = { "+": lambda x, y: x + y, "-": lambda x, y: x - y, "*": lambda x, y: x * y, "/": lambda x, y: x // y if x * y >= 0 else -(-x // y), } for token in tokens: ...
class Solution: def eval_rpn(self, tokens: List[str]) -> int: stack = [] op = {'+': lambda x, y: x + y, '-': lambda x, y: x - y, '*': lambda x, y: x * y, '/': lambda x, y: x // y if x * y >= 0 else -(-x // y)} for token in tokens: if token in op: n2 = stack.pop()...
# Created by MechAviv # Map ID :: 402000630 # Desert Cavern : Below the Sinkhole # Update Quest Record EX | Quest ID: [34931] | Data: dir=1;exp=1 sm.curNodeEventEnd(True) sm.setTemporarySkillSet(0) sm.setInGameDirectionMode(True, False, False, False) sm.setStandAloneMode(True) sm.removeAdditionalEffect() sm.zoomCamera...
sm.curNodeEventEnd(True) sm.setTemporarySkillSet(0) sm.setInGameDirectionMode(True, False, False, False) sm.setStandAloneMode(True) sm.removeAdditionalEffect() sm.zoomCamera(0, 2000, 0, -142, -250) sm.blind(1, 255, 0, 0, 0, 0, 0) sm.sendDelay(1200) sm.blind(0, 0, 0, 0, 0, 1000, 0) sm.sendDelay(1400) sm.sendDelay(500) s...
# "directions" are all the ways you can describe going some way; # they are code-visible names for directions for adventure authors direction_names = ["NORTH","SOUTH","EAST","WEST","UP","DOWN","RIGHT","LEFT", "IN","OUT","FORWARD","BACK", "NORTHWEST","NORTHEAST","SOUTHWEST","SOUTHE...
direction_names = ['NORTH', 'SOUTH', 'EAST', 'WEST', 'UP', 'DOWN', 'RIGHT', 'LEFT', 'IN', 'OUT', 'FORWARD', 'BACK', 'NORTHWEST', 'NORTHEAST', 'SOUTHWEST', 'SOUTHEAST'] direction_list = [north, south, east, west, up, down, right, left, in, out, forward, back, northwest, northeast, southwest, southeast] = range(len(direc...
# -*- coding:utf-8 -*- __author__ = 'zhangzhibo' __date__ = '202018/5/18 16:56'
__author__ = 'zhangzhibo' __date__ = '202018/5/18 16:56'
#Clases del ciclo de lavado class lavando: #Etapa 1. Lavado def lavado(self): print("Lavando...") class enjuagando: #Etapa 2. Enjuagado def enjuagado(self): print("Enjuagando...") class centrifugando: #Etapa 3. Centrifugado def centrifugado(self): print("Centrifugando....
class Lavando: def lavado(self): print('Lavando...') class Enjuagando: def enjuagado(self): print('Enjuagando...') class Centrifugando: def centrifugado(self): print('Centrifugando...') class Finalizado: def finalizar(self): print('Finalizado!') class Lavadorafaca...
''' Date: 01/08/2019 Problem description: =================== This problem was asked by Google. Given an array of integers where every integer occurs three times except for one integer, which only occurs once, find and return the non-duplicated integer. For example, given [6, 1, 3, 3, 3, 6, 6], return 1. Given [1...
""" Date: 01/08/2019 Problem description: =================== This problem was asked by Google. Given an array of integers where every integer occurs three times except for one integer, which only occurs once, find and return the non-duplicated integer. For example, given [6, 1, 3, 3, 3, 6, 6], return 1. Given [1...
# Start and end date gldas_start_date = '2010-01-01' gldas_end_date = '2014-01-01' # Location (Latitude and Longitude) gldas_geo_point = AutoParam([(38, -117), (38, -118)]) # Create data fetcher gldasdf = GLDASDF([gldas_geo_point],start_date=gldas_start_date, end_date=gldas_end_date, resample=Fals...
gldas_start_date = '2010-01-01' gldas_end_date = '2014-01-01' gldas_geo_point = auto_param([(38, -117), (38, -118)]) gldasdf = gldasdf([gldas_geo_point], start_date=gldas_start_date, end_date=gldas_end_date, resample=False)
def hola(): def bienvenido(): print("hola!") return bienvenido # hola()() def mensaje(): return "Este es un mensaje" def test(function): print(mensaje()) test(mensaje)
def hola(): def bienvenido(): print('hola!') return bienvenido def mensaje(): return 'Este es un mensaje' def test(function): print(mensaje()) test(mensaje)
# Getting all PAL : Prime and pallindrome numbers between two given numbers def pallindrome(n): temp=n rev=0 while(n>0): dig = n % 10 rev=rev*10 +dig n = n/10 if temp == rev: return True else: return False def isprime(n): if n<=1: return False if n<=3: return True if n % 2 == 0 or n % 3 == ...
def pallindrome(n): temp = n rev = 0 while n > 0: dig = n % 10 rev = rev * 10 + dig n = n / 10 if temp == rev: return True else: return False def isprime(n): if n <= 1: return False if n <= 3: return True if n % 2 == 0 or n % 3 == ...
# buttons PIN_BUTTON_PROG = 17 PIN_BUTTON_ERASE = 27 # LEDs PIN_RED = 23 PIN_GREEN = 24 PIN_BLUE = 20 PIN_BLUE2 = 25 # Jumpers PINS_PROFILES = [5, 6, 13, 19] # MCU PIN_RESET_ATMEGA = 16 PIN_MASTER_POWER = 12 PIN_ESP_RESET = 8 PIN_ESP_GPIO_0 = 4 # MISC PIN_BUZZER = 26 # Interfaces DEFAULT_SERIAL_SPEED = 9600 DEFAUL...
pin_button_prog = 17 pin_button_erase = 27 pin_red = 23 pin_green = 24 pin_blue = 20 pin_blue2 = 25 pins_profiles = [5, 6, 13, 19] pin_reset_atmega = 16 pin_master_power = 12 pin_esp_reset = 8 pin_esp_gpio_0 = 4 pin_buzzer = 26 default_serial_speed = 9600 default_prgm_comm_speed = 115200 serial_port = '/dev/serial0'
# -*- coding: utf-8 -*- smtpserver = "smtp.qq.com" # will be read by smtp fixture def test_showhelo(smtp_connection): assert 0, smtp_connection.helo()
smtpserver = 'smtp.qq.com' def test_showhelo(smtp_connection): assert 0, smtp_connection.helo()
# -*- coding: utf-8 -*- project = 'test' master_doc = 'index'
project = 'test' master_doc = 'index'
s, n = map(int, input().split()) arr = [0] * n for i in range(s): p = int(input()) for j in range(0, len(arr), p): arr[j] = 1 for i in arr: print(i, end=" ") print()
(s, n) = map(int, input().split()) arr = [0] * n for i in range(s): p = int(input()) for j in range(0, len(arr), p): arr[j] = 1 for i in arr: print(i, end=' ') print()
CHAMP_ID_TO_EMOJI = {'266': '<:champ_266:601909182748164097>', '103': '<:champ_103:601909185243774976>', '84': '<:champ_84:601909188612063233>', '12': '<:champ_12:601909190809878530>', '32': '<:champ_32:601909193456222221>', '34': '<:champ_34:601909195968610356>', '1': '<:champ_1:601909198799896690>', '22': '<:champ_22...
champ_id_to_emoji = {'266': '<:champ_266:601909182748164097>', '103': '<:champ_103:601909185243774976>', '84': '<:champ_84:601909188612063233>', '12': '<:champ_12:601909190809878530>', '32': '<:champ_32:601909193456222221>', '34': '<:champ_34:601909195968610356>', '1': '<:champ_1:601909198799896690>', '22': '<:champ_22...
class Preciousstone: def __init__(self): self.preciousStone = [] def storePreciousStone(self,name): self.preciousStone.append(name) if( len(self.preciousStone) > 5): del(self.preciousStone[0]) def displayPreciousStone(self): if(...
class Preciousstone: def __init__(self): self.preciousStone = [] def store_precious_stone(self, name): self.preciousStone.append(name) if len(self.preciousStone) > 5: del self.preciousStone[0] def display_precious_stone(self): if len(self.preciousStone) > 0: ...
class BufferList: def __init__(self, maxlen): self.data = [] self.maxlen = maxlen def append(self, el): if len(self.data) == self.maxlen: popped = self.data.pop(0) else: popped = None self.data.append(el) return popped de...
class Bufferlist: def __init__(self, maxlen): self.data = [] self.maxlen = maxlen def append(self, el): if len(self.data) == self.maxlen: popped = self.data.pop(0) else: popped = None self.data.append(el) return popped def peek(self,...
actor_name = input("Enter the actor's name: ") initial_points = int(input("Enter the points form academy: ")) judges_count = int(input("Enter the number of jury: ")) points_needed = 1250.5 for jury in range(judges_count): judges_name = input("Enter the name of jury: ") points_from_judge = float(input("Enter t...
actor_name = input("Enter the actor's name: ") initial_points = int(input('Enter the points form academy: ')) judges_count = int(input('Enter the number of jury: ')) points_needed = 1250.5 for jury in range(judges_count): judges_name = input('Enter the name of jury: ') points_from_judge = float(input('Enter the...
print("hello world") a = 3 b = 4 c = a * b print(c)
print('hello world') a = 3 b = 4 c = a * b print(c)
################################################# ### THIS FILE WAS AUTOGENERATED! DO NOT EDIT! ### ################################################# def get_resize_target(img_sz, crop_target, do_crop=False): if crop_target is None: return None ch,r,c = img_sz target_r,target_c = c...
def get_resize_target(img_sz, crop_target, do_crop=False): if crop_target is None: return None (ch, r, c) = img_sz (target_r, target_c) = crop_target ratio = (min if do_crop else max)(r / target_r, c / target_c) return (ch, round(r / ratio), round(c / ratio))
def func3(a): a/0; def func2(a, b): func3(a); def func1(a, b, c): func2(a, b); if __name__ == "__main__": func1(12, 0, 89)
def func3(a): a / 0 def func2(a, b): func3(a) def func1(a, b, c): func2(a, b) if __name__ == '__main__': func1(12, 0, 89)
def setup(): global pg pg = createGraphics(1000, 1000) noLoop() def draw(): pg.beginDraw() pg.colorMode(HSB, 360, 100, 100, 100) pg.background(0, 0, 25) pg.stroke(60, 7, 86, 100) pg.noFill() for i in range(100): pg.ellipse(random(pg.width), random(pg.height), 100, 100) pg.endDraw() pg.save(...
def setup(): global pg pg = create_graphics(1000, 1000) no_loop() def draw(): pg.beginDraw() pg.colorMode(HSB, 360, 100, 100, 100) pg.background(0, 0, 25) pg.stroke(60, 7, 86, 100) pg.noFill() for i in range(100): pg.ellipse(random(pg.width), random(pg.height), 100, 100) ...
n=list(map(int,input("Enter the list").split(","))) le=max(n) while max(n)==le: n.remove(max(n)) print(max(n))
n = list(map(int, input('Enter the list').split(','))) le = max(n) while max(n) == le: n.remove(max(n)) print(max(n))
for i in range(int(input())): text = input().replace('.', '') countOpen = 0 countDiamonds = 0 for char in text: if char == '<': countOpen += 1 elif char == '>' and countOpen > 0: countDiamonds += 1 countOpen -= 1 print(countDiamonds)
for i in range(int(input())): text = input().replace('.', '') count_open = 0 count_diamonds = 0 for char in text: if char == '<': count_open += 1 elif char == '>' and countOpen > 0: count_diamonds += 1 count_open -= 1 print(countDiamonds)
def read_n_values(n): print("Please enter", n, "values.") values = [] for i in range(n): values.append(input("Value {}: ".format(i + 1))) return values def compute_average(values): # set sum to first value of list total_sum = values[0] # iterate over remaining values and add them...
def read_n_values(n): print('Please enter', n, 'values.') values = [] for i in range(n): values.append(input('Value {}: '.format(i + 1))) return values def compute_average(values): total_sum = values[0] for value in values[1:]: total_sum += value return float(total_sum) / le...
load("@rules_python//python:python.bzl", "py_binary", "py_library", "py_test") def py3_library(*args, **kwargs): py_library( srcs_version = "PY3", *args, **kwargs ) def py3_binary(name, main = None, *args, **kwargs): if main == None: main = "%s.py" % (name) py_binary( ...
load('@rules_python//python:python.bzl', 'py_binary', 'py_library', 'py_test') def py3_library(*args, **kwargs): py_library(*args, srcs_version='PY3', **kwargs) def py3_binary(name, main=None, *args, **kwargs): if main == None: main = '%s.py' % name py_binary(*args, name=name, main=main, legacy_cr...
try: test = int(input().strip()) while test!=0: k,d0,d1 = map(int,input().strip().split()) d2 = (d1+d0)%10 if k == 2: if (d1+d0)%3 == 0: print("YES") continue else: print("NO") continue elif k...
try: test = int(input().strip()) while test != 0: (k, d0, d1) = map(int, input().strip().split()) d2 = (d1 + d0) % 10 if k == 2: if (d1 + d0) % 3 == 0: print('YES') continue else: print('NO') continue...
## # This software was developed and / or modified by Raytheon Company, # pursuant to Contract DG133W-05-CQ-1067 with the US Government. # # U.S. EXPORT CONTROLLED TECHNICAL DATA # This software product contains export-restricted data whose # export/transfer/disclosure is restricted by U.S. law. Dissemination # to ...
class Pointdataview: def __init__(self, javaPointDataView): self.__javaPdv = javaPointDataView self.__keys = [] keyset = self.__javaPdv.getContainer().getParameters() itr = keyset.iterator() while itr.hasNext(): self.__keys.append(str(itr.next())) def __geti...