content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
# djamplek8s/__init__.py """ A Django example project for Kubernetes """ __version__ = "0.0.2" __title__ = "djamplek8s" __description__ = "Django example project for Kubernetes" __uri__ = "https://github.com/maartenq/djamplek8s" __author__ = "Maarten" __email__ = "ikmaarten@gmail.com" __license__ = "MIT or Apache Lic...
""" A Django example project for Kubernetes """ __version__ = '0.0.2' __title__ = 'djamplek8s' __description__ = 'Django example project for Kubernetes' __uri__ = 'https://github.com/maartenq/djamplek8s' __author__ = 'Maarten' __email__ = 'ikmaarten@gmail.com' __license__ = 'MIT or Apache License, Version 2.0' __copyri...
def _fetch_signature(nmf_genes, signature): """ Group and sort NMF signatures. Return the table for a single signature Parameters: ----------- nmf_genes gene x signature table type: pandas.DataFrame signature NMF gene signature selection type: int or float ...
def _fetch_signature(nmf_genes, signature): """ Group and sort NMF signatures. Return the table for a single signature Parameters: ----------- nmf_genes gene x signature table type: pandas.DataFrame signature NMF gene signature selection type: int or float "...
""" Given a non-empty array of non-negative integers nums, the degree of this array is defined as the maximum frequency of any one of its elements. Your task is to find the smallest possible length of a (contiguous) subarray of nums, that has the same degree as nums. Example 1: Input: [1, 2, 2, 3, 1] Output: 2 Explan...
""" Given a non-empty array of non-negative integers nums, the degree of this array is defined as the maximum frequency of any one of its elements. Your task is to find the smallest possible length of a (contiguous) subarray of nums, that has the same degree as nums. Example 1: Input: [1, 2, 2, 3, 1] Output: 2 Explan...
n = int(input()) f = {} ans = set() for i in range(n): tmp = input().split() if tmp[0] not in f.values(): ans.add(tmp[0]) f[tmp[0]] = tmp[1] print(len(ans)) for old in ans: new = old while new in f.keys(): new = f[new] print(old, new)
n = int(input()) f = {} ans = set() for i in range(n): tmp = input().split() if tmp[0] not in f.values(): ans.add(tmp[0]) f[tmp[0]] = tmp[1] print(len(ans)) for old in ans: new = old while new in f.keys(): new = f[new] print(old, new)
# -*- coding: utf-8 -*- """Digital Forensics Date and Time (dfDateTime). dfDateTime, or Digital Forensics date and time, provides date and time objects to preserve accuracy and precision. """ __version__ = '20180324'
"""Digital Forensics Date and Time (dfDateTime). dfDateTime, or Digital Forensics date and time, provides date and time objects to preserve accuracy and precision. """ __version__ = '20180324'
# TODO: Things that might be implemented some time #VisItExecuteCommand #VisItSaveWindow #VisItInitializeRuntime """ Excerpt from the visit/simv2 sources: int VisItAddPlot(const char *plotType, const char *var); int VisItAddOperator(const char *operatorType, int applyToAll); int VisItDrawPlots(void); int VisItDeleteA...
""" Excerpt from the visit/simv2 sources: int VisItAddPlot(const char *plotType, const char *var); int VisItAddOperator(const char *operatorType, int applyToAll); int VisItDrawPlots(void); int VisItDeleteActivePlots(void); /* Maybe having 1 function is better...*/ int VisItSetPlotOptionsC(int id,const char*n,char v); ...
""" Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST. Calling next() will return the next smallest number in the BST. Note: next() and hasNext() should run in average O(1) time and uses O(h) memory, where h is the height of the tree. """ __author__ =...
""" Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST. Calling next() will return the next smallest number in the BST. Note: next() and hasNext() should run in average O(1) time and uses O(h) memory, where h is the height of the tree. """ __author__ =...
x1 = 0 x2 = 1 s = 0 while True: fib = x1 + x2 x1 = x2 x2 = fib if fib % 2 == 0: s += fib if fib >= 4e6: break print(s)
x1 = 0 x2 = 1 s = 0 while True: fib = x1 + x2 x1 = x2 x2 = fib if fib % 2 == 0: s += fib if fib >= 4000000.0: break print(s)
class Sprite(): ''' The Sprite class manipulates the imported sprite and is utilized for texture mapping Attributes: matrix (array): the color encoded 2d matrix of the sprite width (int): width of the 2d sprite matrix height (int): heigth of the 2d sprite matrix ...
class Sprite: """ The Sprite class manipulates the imported sprite and is utilized for texture mapping Attributes: matrix (array): the color encoded 2d matrix of the sprite width (int): width of the 2d sprite matrix height (int): heigth of the 2d sprite matrix ...
#menjalankan python a=10 b=2 c=a/b print(c) print("-------------------------") #penulisan variabel Nama="Fazlur" _nama="Fazlur" nama="Zul" print(Nama) print(_nama) print(nama) print("-------------------------") #mengenal nilai dan tipe data dalam python a=1 makanan ="ayam" print(type(makanan)) pri...
a = 10 b = 2 c = a / b print(c) print('-------------------------') nama = 'Fazlur' _nama = 'Fazlur' nama = 'Zul' print(Nama) print(_nama) print(nama) print('-------------------------') a = 1 makanan = 'ayam' print(type(makanan)) print(type(a)) print('-------------------------') tanya = input('masukan nama?') print(tany...
PATH={ "amass":"../amass/amass", "subfinder":"../subfinder", "fierce":"../fierce/fierce/fierce.py", "dirsearch":"../dirsearch/dirsearch.py" }
path = {'amass': '../amass/amass', 'subfinder': '../subfinder', 'fierce': '../fierce/fierce/fierce.py', 'dirsearch': '../dirsearch/dirsearch.py'}
class TreeNode(): def __init__(self, x): self.val = x self.left = None self.right = None def __repr__(self): return '<TreeNode {}>'.format(self.val) def sorted_array_to_bst(arr): """ Given a sorted array turn it into a balanced binary tree """ if len(arr) == 0:...
class Treenode: def __init__(self, x): self.val = x self.left = None self.right = None def __repr__(self): return '<TreeNode {}>'.format(self.val) def sorted_array_to_bst(arr): """ Given a sorted array turn it into a balanced binary tree """ if len(arr) == 0: ...
def get_input(): total_cows = int(input("")) cow_str = input("") return total_cows, cow_str def calc_lonely_cow(total_cows, cow_str): total_lonely_cow = 0 #for offset in range(3, total_cows + 1): for offset in range(3, 60): for start_pos in range(0, total_cows): total_count...
def get_input(): total_cows = int(input('')) cow_str = input('') return (total_cows, cow_str) def calc_lonely_cow(total_cows, cow_str): total_lonely_cow = 0 for offset in range(3, 60): for start_pos in range(0, total_cows): total_count_g = total_count_h = 0 if start_...
# use part function of problem 290 class Solution: def isIsomorphic(self, s, t): """ :type s: str :type t: str :rtype: bool """ def get_p(string): p = [] keys = [] for word in string: if len(keys) == 0: ...
class Solution: def is_isomorphic(self, s, t): """ :type s: str :type t: str :rtype: bool """ def get_p(string): p = [] keys = [] for word in string: if len(keys) == 0: keys.append(word) ...
class Parameterset(object): """ Parameter set """ def __init__(self, name, description, uri=None): self.name = name self.description = description self.uri = uri self.params = {} def _load_from_uri(self): pass def parameterset(model, name, kw...
class Parameterset(object): """ Parameter set """ def __init__(self, name, description, uri=None): self.name = name self.description = description self.uri = uri self.params = {} def _load_from_uri(self): pass def parameterset(model, name, kwds): if not kwds: ...
# -*- coding: utf-8 -*- class InvalidTodoFile(Exception): pass class InvalidTodoStatus(Exception): pass
class Invalidtodofile(Exception): pass class Invalidtodostatus(Exception): pass
num=int(input("Enter a number: ")) sum=0 for i in range(len(str(num))): sum=sum+(num%10) num=num//10 print("The sum of the digits in the number entered is: ",sum)
num = int(input('Enter a number: ')) sum = 0 for i in range(len(str(num))): sum = sum + num % 10 num = num // 10 print('The sum of the digits in the number entered is: ', sum)
words_count = int(input()) english_persian_dict = {} france_persian_dict = {} german_persian_dict = {} for i in range(words_count): words = input().split() english_persian_dict[words[1]] = words[0] france_persian_dict[words[2]] = words[0] german_persian_dict[words[3]] = words[0] sentence = input() ...
words_count = int(input()) english_persian_dict = {} france_persian_dict = {} german_persian_dict = {} for i in range(words_count): words = input().split() english_persian_dict[words[1]] = words[0] france_persian_dict[words[2]] = words[0] german_persian_dict[words[3]] = words[0] sentence = input() trans...
class tiger: def __init__(self, name: str): self._name = name def name(self) -> str: return self._name @staticmethod def greet() -> str: return "Mijau!" @staticmethod def menu() -> str: return "mlako mlijeko"
class Tiger: def __init__(self, name: str): self._name = name def name(self) -> str: return self._name @staticmethod def greet() -> str: return 'Mijau!' @staticmethod def menu() -> str: return 'mlako mlijeko'
#!/usr/bin/env/python class ABcd: _types_map = { "Child1": {"type": int, "subtype": None}, "Child2": {"type": str, "subtype": None}, } _formats_map = {} def __init__(self, Child1=None, Child2=None): pass self.__Child1 = Child1 self.__Child2 = Child2 def _...
class Abcd: _types_map = {'Child1': {'type': int, 'subtype': None}, 'Child2': {'type': str, 'subtype': None}} _formats_map = {} def __init__(self, Child1=None, Child2=None): pass self.__Child1 = Child1 self.__Child2 = Child2 def _get__child1(self): return self.__Child1 ...
cities = [ 'Rome', 'Milan', 'Naples', 'Turin', 'Palermo', 'Genoa', 'Bologna', 'Florence', 'Catania', 'Bari', 'Messina', 'Verona', 'Padova', 'Trieste', 'Brescia', 'Prato', 'Taranto', 'Reggio Calabria', 'Modena', 'Livorno', 'Cagliari', ...
cities = ['Rome', 'Milan', 'Naples', 'Turin', 'Palermo', 'Genoa', 'Bologna', 'Florence', 'Catania', 'Bari', 'Messina', 'Verona', 'Padova', 'Trieste', 'Brescia', 'Prato', 'Taranto', 'Reggio Calabria', 'Modena', 'Livorno', 'Cagliari', 'Mestre', 'Parma', 'Foggia', "Reggio nell'Emilia", 'Acilia-Castel Fusano-Ostia Antica',...
def check(func): def inner(a, b): if b == 0: return "Can't divide by 0" elif b > a: return b/a return func(a, b) return inner @check def div(a, b): return a/b print(div(10, 0))
def check(func): def inner(a, b): if b == 0: return "Can't divide by 0" elif b > a: return b / a return func(a, b) return inner @check def div(a, b): return a / b print(div(10, 0))
# Program to search for Happy Numbers """ A Happy Number is a number where the sum of digits squared s equal to 1 ultimately. What do we mean by ultimately? The best way is to learn by an example. Example 10 = 12 + 02 = 1 + 0=1. So 10 is a Happy Number Let us try with 19 sum =12 + 92 = 1 + 81 = 82 sum=82 + 22 = 64 +...
""" A Happy Number is a number where the sum of digits squared s equal to 1 ultimately. What do we mean by ultimately? The best way is to learn by an example. Example 10 = 12 + 02 = 1 + 0=1. So 10 is a Happy Number Let us try with 19 sum =12 + 92 = 1 + 81 = 82 sum=82 + 22 = 64 + 4 = 68 sum=62 + 82 = 36 + 64 = 100 sum=...
def f(a, d): """ :param a : foo :param d : quux """
def f(a, d): """ :param a : foo :param d : quux """
# NameID Formats from the SAML Core 2.0 spec (8.3 Name Identifier Format Identifiers) UNSPECIFIED = "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified" EMAIL = "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress" PERSISTENT = "urn:oasis:names:tc:SAML:2.0:nameid-format:persistent" TRANSIENT = "urn:oasis:names:tc...
unspecified = 'urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified' email = 'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress' persistent = 'urn:oasis:names:tc:SAML:2.0:nameid-format:persistent' transient = 'urn:oasis:names:tc:SAML:2.0:nameid-format:transient' x509_subject = 'urn:oasis:names:tc:SAML:1.1:nameid-...
Sweep_width_List = { 'Person':{ '150':{ '6':0.7, '9':0.7, '19':0.9, '28':0.9, '37':0.9 }, '300':{ '6':0.7, '9':0.7, '19':0.9, '28':0.9, '37':0.9 }, '450':(...
sweep_width__list = {'Person': {'150': {'6': 0.7, '9': 0.7, '19': 0.9, '28': 0.9, '37': 0.9}, '300': {'6': 0.7, '9': 0.7, '19': 0.9, '28': 0.9, '37': 0.9}, '450': (), '600': ()}, 'Vehicle': {'150': {'6': 1.7, '9': 2.4, '19': 2.4, '28': 2.4, '37': 2.4}, '300': {'6': 2.6, '9': 2.6, '19': 2.8, '28': 2.8, '37': 2.8}, '450'...
num = int(input()) n = int((num - 1) / 2) for l in range(n+1): space = ' ' * (n - l) nums = [str(i) for i in range(n-l+1, n-l+1+3)] left = space + ''.join(nums) + ' ' * l right = left[::-1].rstrip() middle = (str(num) if l == 0 else ' ') print(left+middle+right) for l in range(n, -1, -1): sp...
num = int(input()) n = int((num - 1) / 2) for l in range(n + 1): space = ' ' * (n - l) nums = [str(i) for i in range(n - l + 1, n - l + 1 + 3)] left = space + ''.join(nums) + ' ' * l right = left[::-1].rstrip() middle = str(num) if l == 0 else ' ' print(left + middle + right) for l in range(n, -...
# coding: utf-8 # Copyright 2020, Oracle Corporation and/or its affiliates. FILTER_ERR = 'Some of the chosen filters were not found, we cannot continue.'
filter_err = 'Some of the chosen filters were not found, we cannot continue.'
# Internationalization # https://docs.djangoproject.com/en/dev/topics/i18n/ LANGUAGE_CODE = 'ru-RU' TIME_ZONE = 'Asia/Yekaterinburg' USE_I18N = True USE_L10N = True USE_TZ = True
language_code = 'ru-RU' time_zone = 'Asia/Yekaterinburg' use_i18_n = True use_l10_n = True use_tz = True
# Copyright (c) 2012, Tom Hendrikx # All rights reserved. # # See LICENSE for the license. VERSION = 'GIT'
version = 'GIT'
class RequestHeaderMiddleware(object): def __init__(self, headers): self._headers = headers @classmethod def from_crawler(cls, crawler): headers = { 'Referer': 'http://www.fundsupermart.com.hk/hk/main/home/index.svdo', 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel M...
class Requestheadermiddleware(object): def __init__(self, headers): self._headers = headers @classmethod def from_crawler(cls, crawler): headers = {'Referer': 'http://www.fundsupermart.com.hk/hk/main/home/index.svdo', 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebK...
# -*- coding: utf-8 -*- class Solution: def projectionArea(self, grid): result = 0 for i in range(len(grid)): for j in range(len(grid[0])): if grid[i][j]: result += 1 for i in range(len(grid)): partial = 0 for j in r...
class Solution: def projection_area(self, grid): result = 0 for i in range(len(grid)): for j in range(len(grid[0])): if grid[i][j]: result += 1 for i in range(len(grid)): partial = 0 for j in range(len(grid[0])): ...
# -*- coding: utf-8 -*- """Copyright 2020 Jeremy Pardo @grm34 https://github.com/grm34. 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 requi...
"""Copyright 2020 Jeremy Pardo @grm34 https://github.com/grm34. 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 ...
user_db = '' password_db = '' def register(username,password,repeat_password): if password == repeat_password: user_db = username password_db = password return user_db,password_db else: return 'Paroli ne sovpadaut!' print(register('zarina','123456','1234567'))
user_db = '' password_db = '' def register(username, password, repeat_password): if password == repeat_password: user_db = username password_db = password return (user_db, password_db) else: return 'Paroli ne sovpadaut!' print(register('zarina', '123456', '1234567'))
stats_default_config = { "retention_size": 1024, "retention_time": 365, "wal_compression": "false", "storage_path": '"./stats_data"', "prometheus_auth_enabled": "true", "log_level": '"debug"', "max_block_duration": 25, "scrape_interval": 10, "scrape_timeout": 10, "snapshot_timeou...
stats_default_config = {'retention_size': 1024, 'retention_time': 365, 'wal_compression': 'false', 'storage_path': '"./stats_data"', 'prometheus_auth_enabled': 'true', 'log_level': '"debug"', 'max_block_duration': 25, 'scrape_interval': 10, 'scrape_timeout': 10, 'snapshot_timeout_msecs': 30000, 'token_file': 'prometheu...
#returns the quotient and remainder of the number #retturns two arguements #first arguement gives the quotient #second arguement gives the remainder print(divmod(9,2)) print(divmod(9.6,2.5))
print(divmod(9, 2)) print(divmod(9.6, 2.5))
class FormatInput(): def add_low_quality_SNV_info(self,CNV_information,total_read, alt_read,total_read_cut,mutant_read_cut): New_CNV_information={} for tumor in CNV_information: CNVinfo=CNV_information[tumor] TotRead=total_read[tumor] AltRead=alt_read[tumor] ...
class Formatinput: def add_low_quality_snv_info(self, CNV_information, total_read, alt_read, total_read_cut, mutant_read_cut): new_cnv_information = {} for tumor in CNV_information: cn_vinfo = CNV_information[tumor] tot_read = total_read[tumor] alt_read = alt_rea...
''' URL: https://leetcode.com/problems/island-perimeter/ Difficulty: Easy Description: Island Perimeter You are given row x col grid representing a map where grid[i][j] = 1 represents land and grid[i][j] = 0 represents water. Grid cells are connected horizontally/vertically (not diagonally). The grid is completely ...
""" URL: https://leetcode.com/problems/island-perimeter/ Difficulty: Easy Description: Island Perimeter You are given row x col grid representing a map where grid[i][j] = 1 represents land and grid[i][j] = 0 represents water. Grid cells are connected horizontally/vertically (not diagonally). The grid is completely ...
class Solution(object): def subdomainVisits(self, cpdomains): """ :type cpdomains: List[str] :rtype: List[str] """ counter = collections.Counter() for item in cpdomains: num, url = item.split() num = int(num) i = 0 while...
class Solution(object): def subdomain_visits(self, cpdomains): """ :type cpdomains: List[str] :rtype: List[str] """ counter = collections.Counter() for item in cpdomains: (num, url) = item.split() num = int(num) i = 0 w...
# # PySNMP MIB module CISCO-BULK-FILE-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-BULK-FILE-MIB # Produced by pysmi-0.3.4 at Wed May 1 11:51:35 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default...
(object_identifier, integer, octet_string) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'Integer', 'OctetString') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_union, single_value_constraint, value_size_constraint, value_range_constraint, constraints_intersection) ...
# -*- coding: utf-8 -*- def doinput(self): dtuid = ('log', 9) rhouid = ('log', 15) parentuid = ('well', 0) dtlog = self._OM.get(dtuid) rholog = self._OM.get(rhouid) dtdata = dtlog.data rhodata = rholog.data self.input = dict(dtdata=dtdata, rhodata=rhodata, parentuid=parentuid) re...
def doinput(self): dtuid = ('log', 9) rhouid = ('log', 15) parentuid = ('well', 0) dtlog = self._OM.get(dtuid) rholog = self._OM.get(rhouid) dtdata = dtlog.data rhodata = rholog.data self.input = dict(dtdata=dtdata, rhodata=rhodata, parentuid=parentuid) return True def dojob(self, d...
MADHUSUDANA_MASA = 0 TRIVIKRAMA_MASA = 1 VAMANA_MASA = 2 SRIDHARA_MASA = 3 HRSIKESA_MASA = 4 PADMANABHA_MASA = 5 DAMODARA_MASA = 6 KESAVA_MASA = 7 NARAYANA_MASA = 8 MADHAVA_MASA = 9 GOVINDA_MASA = 10 VISNU_MASA = 11 ADHIKA_MASA = 12
madhusudana_masa = 0 trivikrama_masa = 1 vamana_masa = 2 sridhara_masa = 3 hrsikesa_masa = 4 padmanabha_masa = 5 damodara_masa = 6 kesava_masa = 7 narayana_masa = 8 madhava_masa = 9 govinda_masa = 10 visnu_masa = 11 adhika_masa = 12
# adding two matrices using nested loop """ x = ['12', '72', '43']['34', '54', '34']['32', '23', '24'] y = ['5', '3', '5']['3', '2', '1']['5', '5', '2'] result = x + y print(result) """ x = [['1', '2', '3'], ['4', '5', '6'], ['7', '8', '9']] y = [['1', '2', '3'], ['4', '5', '6'], ...
""" x = ['12', '72', '43']['34', '54', '34']['32', '23', '24'] y = ['5', '3', '5']['3', '2', '1']['5', '5', '2'] result = x + y print(result) """ x = [['1', '2', '3'], ['4', '5', '6'], ['7', '8', '9']] y = [['1', '2', '3'], ['4', '5', '6'], ['7', '8', '9']] result = [['0', '0', '0'], ['0', '0', '0'], ['0', '0', '0'...
# Define an initial dictionary my_dict = { 'one': 1, 'two': 2, 'three': 3, } # Add a new number to the end of the dictionary my_dict['four'] = 4 # Print out the dictionary print(my_dict) # Print the value 'one' of the dictionary print(my_dict['one']) # Change a value on the dictionary my_dict['one'] = 5 # Pr...
my_dict = {'one': 1, 'two': 2, 'three': 3} my_dict['four'] = 4 print(my_dict) print(my_dict['one']) my_dict['one'] = 5 print(my_dict)
''' Created on Jan 1, 2019 @author: Winterberger ''' #Write your function here def middle_element(lst): #print(len(lst)) #print(len(lst) % 2) if 0 == len(lst) % 2: ind1 = int(len(lst)/2-1) ind2 = int(len(lst)/2) item1 = lst[int(len(lst)/2-1)] item2 = lst[int(len(lst)/2)] print(i...
""" Created on Jan 1, 2019 @author: Winterberger """ def middle_element(lst): if 0 == len(lst) % 2: ind1 = int(len(lst) / 2 - 1) ind2 = int(len(lst) / 2) item1 = lst[int(len(lst) / 2 - 1)] item2 = lst[int(len(lst) / 2)] print(ind1) print(ind2) print(item1) ...
class MissingValue: def __init__(self, required_value: str, headers: list[str]): super().__init__() self.__current_row = 0 self.__required_value = required_value self.__headers = headers self.__failures = {} if required_value in headers: self.__required_v...
class Missingvalue: def __init__(self, required_value: str, headers: list[str]): super().__init__() self.__current_row = 0 self.__required_value = required_value self.__headers = headers self.__failures = {} if required_value in headers: self.__required_v...
""" Write a program to take the list of names below and print "Hello, {first} {last}" for each item in the list """ names = ["Jobs, Steve", "Gates, Bill", "Musk, Elon", "Hopper, Grace"] #Create a for loop to get each full name for full_name in names: #Method for finding the separator sep = full_name.find(",") #...
""" Write a program to take the list of names below and print "Hello, {first} {last}" for each item in the list """ names = ['Jobs, Steve', 'Gates, Bill', 'Musk, Elon', 'Hopper, Grace'] for full_name in names: sep = full_name.find(',') first = full_name[sep + 2:] last = full_name[0:sep] print('Hello'...
class Ability: cost = None exhaustible = True constant = False def __init__(self, cost, context): self.cost = cost def get_context(self): return self.cost.context def is_valid(self, cost): return cost.context == self.get_context() and cost == self.cost
class Ability: cost = None exhaustible = True constant = False def __init__(self, cost, context): self.cost = cost def get_context(self): return self.cost.context def is_valid(self, cost): return cost.context == self.get_context() and cost == self.cost
# -*- coding: utf-8 -*- def main(): q, h, s, d = list(map(int, input().split())) n = int(input()) # See: # https://www.youtube.com/watch?v=9OiB8ot3a0w x = min(4 * q, h * 2, s) print(min(n * x, d * (n // 2) + n % 2 * x)) if __name__ == '__main__': main()
def main(): (q, h, s, d) = list(map(int, input().split())) n = int(input()) x = min(4 * q, h * 2, s) print(min(n * x, d * (n // 2) + n % 2 * x)) if __name__ == '__main__': main()
# -*- coding: utf-8 -*- __author__ = 'alsbi' HOST_LOCAL_VIRSH = 'libvirt_local or remote host' HOST_REMOTE_VIRSH = 'libvirt remote host' SASL_USER = "libvirt sasl user" SASL_PASS = "libvirt sasl pass" SECRET_KEY_APP = 'random' LOGINS = {'admin': 'admin'}
__author__ = 'alsbi' host_local_virsh = 'libvirt_local or remote host' host_remote_virsh = 'libvirt remote host' sasl_user = 'libvirt sasl user' sasl_pass = 'libvirt sasl pass' secret_key_app = 'random' logins = {'admin': 'admin'}
print(1) print(1 + 1) print(3 * 1 + 2) print(3 * (1 + 2)) if 2 > 1: print("One is the loneliest number") else: print('Two is the lonliest number?')
print(1) print(1 + 1) print(3 * 1 + 2) print(3 * (1 + 2)) if 2 > 1: print('One is the loneliest number') else: print('Two is the lonliest number?')
# https://dmoj.ca/problem/ccc07j1 # https://dmoj.ca/submission/1744054 a = int(input()) b = int(input()) c = int(input()) if (a>c and a<b) or (a<c and a>b): print(a) elif (b>c and b<a) or (b<c and b>a): print(b) else: print(c)
a = int(input()) b = int(input()) c = int(input()) if a > c and a < b or (a < c and a > b): print(a) elif b > c and b < a or (b < c and b > a): print(b) else: print(c)
class Myclass: """This is doc string""" a=10 def function(self): print("Hello") print(Myclass.a) print(Myclass.function) print(Myclass.__doc__) Mycl1 = Myclass()
class Myclass: """This is doc string""" a = 10 def function(self): print('Hello') print(Myclass.a) print(Myclass.function) print(Myclass.__doc__) mycl1 = myclass()
# quizScoring.py # A program that accepts a quiz score as an input and prints out # the corresponding grade. # 5-A, 4-B, 3-C, 2-D, 1-F, 0-F """A certain CS professor gives 5-point quizzes that are graded on the scale 5-A, 4-B, 3-C, 2-D, 1-F, 0-F. Write a progra that accepts a quiz score as an input and prints out the c...
"""A certain CS professor gives 5-point quizzes that are graded on the scale 5-A, 4-B, 3-C, 2-D, 1-F, 0-F. Write a progra that accepts a quiz score as an input and prints out the corresponding grade.""" def main(): print('Quiz scoring is a program that accepts a quiz score as an input and prints out the correspond...
# HARD # 1. check length + counts of word + current word with maxWidth # 2. round robin # maxWidth - lenght = number of spaces # loop through number of spaces times # each time assign a space to a word[0] -word[len] # Time O(N) Space O(N) class Solution: def fullJustify(self, words: List[str],...
class Solution: def full_justify(self, words: List[str], maxWidth: int) -> List[str]: line = [] length = 0 result = [] for word in words: if length + len(line) + len(word) > maxWidth: for i in range(maxWidth - length): line[i % (len(li...
class Solution: def matrixReshape(self, nums: List[List[int]], r: int, c: int) -> List[List[int]]: new_matrix=[[0 for _ in range (c)] for _ in range (r)] if r*c!=len(nums)*len(nums[0]): return nums i1=0 j1=0 for j in range(0,len(nums)): for i i...
class Solution: def matrix_reshape(self, nums: List[List[int]], r: int, c: int) -> List[List[int]]: new_matrix = [[0 for _ in range(c)] for _ in range(r)] if r * c != len(nums) * len(nums[0]): return nums i1 = 0 j1 = 0 for j in range(0, len(nums)): fo...
for k in model.state_dict(): print(k) for name,parameters in net.named_parameters(): print(name,':',parameters.size())
for k in model.state_dict(): print(k) for (name, parameters) in net.named_parameters(): print(name, ':', parameters.size())
# Solution to Project Euler Problem 2 def sol(): ans = 0 x = 1 y = 2 while x <= 4000000: if x % 2 == 0: ans += x x, y = y, x + y return str(ans) if __name__ == "__main__": print(sol())
def sol(): ans = 0 x = 1 y = 2 while x <= 4000000: if x % 2 == 0: ans += x (x, y) = (y, x + y) return str(ans) if __name__ == '__main__': print(sol())
class GameState(object): def __init__(self, player, action, card_name): self.action = action self.player = player self.card_name = card_name
class Gamestate(object): def __init__(self, player, action, card_name): self.action = action self.player = player self.card_name = card_name
try: trigger_ver += 1 except: trigger_ver = 1 print(f"dep file version {trigger_ver}: Even if you save this file, this script won't re-execute. Instead, create the trigger file.")
try: trigger_ver += 1 except: trigger_ver = 1 print(f"dep file version {trigger_ver}: Even if you save this file, this script won't re-execute. Instead, create the trigger file.")
class Solution: # @param A a list of integers # @param elem an integer, value need to be removed # @return an integer def removeElement(self, A, elem): if not A: return 0 lens = 0 for i in xrange(0, len(A)): p = A.pop(0) ...
class Solution: def remove_element(self, A, elem): if not A: return 0 lens = 0 for i in xrange(0, len(A)): p = A.pop(0) if p != elem: A.append(p) lens += 1 return lens
# Pay calculator from exercise 02.03 rewritten to give the employee 1.5 times # the hourly rate for hours worked above 40 hours. # Define constants MAX_NORMAL_HOURS = 40 OVERTIME_RATE_MULTIPLIER = 1.5 # Prompt user for hours worked and hourly rate of pay. hours = input('Enter Hours: ') rate = input('Enter rate: ') #...
max_normal_hours = 40 overtime_rate_multiplier = 1.5 hours = input('Enter Hours: ') rate = input('Enter rate: ') hours = float(hours) normal_rate = float(rate) overtime_rate = normal_rate * OVERTIME_RATE_MULTIPLIER if hours <= MAX_NORMAL_HOURS: normal_hours = hours overtime_hours = 0 else: normal_hours = MA...
def chunker(iterable, size): """Return a piece of the specified size of the iterable at a time.""" for i in range(0, len(iterable), size): yield iterable[i:i+size] for chunk in chunker(range(25), 4): print(list(chunk))
def chunker(iterable, size): """Return a piece of the specified size of the iterable at a time.""" for i in range(0, len(iterable), size): yield iterable[i:i + size] for chunk in chunker(range(25), 4): print(list(chunk))
'''THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OT...
"""THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OT...
for i in range(2): for j in range(4): if i == 0 and j == 1: break; print(i, j)
for i in range(2): for j in range(4): if i == 0 and j == 1: break print(i, j)
class FinalValue(Exception): "Force a value and break the handler chain" def __init__(self, value): self.value = value
class Finalvalue(Exception): """Force a value and break the handler chain""" def __init__(self, value): self.value = value
# ann, rets = self.anns[0], [] # for entID, ent, stim in ents: # annID = hash(entID) % self.nANN # unpacked = unpackStim(ent, stim) # self.anns[annID].recv(unpacked, ent, stim, entID) # # #Ret order matters # for logits, val, ent, stim, atn, entID in ann....
class Cosinenet(nn.Module): def __init__(self, xdim, h, ydim): super().__init__() self.feats = feat_net(xdim, h, ydim) self.fc1 = torch.nn.Linear(h, h) self.ent1 = torch.nn.Linear(5, h) def forward(self, stim, conv, flat, ents, ent, actions): x = self.feats(conv, flat, ...
nome = input('Nome: ') print('Nome digitado: ', nome) print('Primeiro caractere: ', nome[0]) print('Ultimo caractere: ', nome[-1]) print('Tres primeiros caracteres: ', nome[0:3]) print('Quarto caractere: ', nome[3]) print('Todos menos o primeiro: ', nome[1:]) print('Os dois ultimos: ', nome[-2:])
nome = input('Nome: ') print('Nome digitado: ', nome) print('Primeiro caractere: ', nome[0]) print('Ultimo caractere: ', nome[-1]) print('Tres primeiros caracteres: ', nome[0:3]) print('Quarto caractere: ', nome[3]) print('Todos menos o primeiro: ', nome[1:]) print('Os dois ultimos: ', nome[-2:])
a = [[3,5]] a[0] = [7] a[1] = [0] a[2] = null
a = [[3, 5]] a[0] = [7] a[1] = [0] a[2] = null
"""Module containing exceptions raised by .""" # Copyleft 2021 Sidon Duarte class GetRmqApiException(Exception): """Base class for all exceptions raised by twine.""" pass
"""Module containing exceptions raised by .""" class Getrmqapiexception(Exception): """Base class for all exceptions raised by twine.""" pass
# Copyright (c) 2018-2022 curoky(cccuroky@gmail.com). # # This file is part of my-own-x. # See https://github.com/curoky/my-own-x for further info. # # 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 Licens...
load('@bazel_gazelle//:deps.bzl', 'go_repository') def go_repositories(): go_repository(name='co_honnef_go_tools', importpath='honnef.co/go/tools', sum='h1:qTakTkI6ni6LFD5sBwwsdSO+AQqbSIxOauHTTQKZ/7o=', version='v0.1.3') go_repository(name='com_github_afex_hystrix_go', importpath='github.com/afex/hystrix-go', ...
# Leo colorizer control file for pseudoplain mode. # This file is in the public domain. # import leo.core.leoGlobals as g # Properties for plain mode. properties = {} # Attributes dict for pseudoplain_main ruleset. pseudoplain_main_attributes_dict = { "default": "null", "digit_re": "", "escap...
properties = {} pseudoplain_main_attributes_dict = {'default': 'null', 'digit_re': '', 'escape': '\\', 'highlight_digits': 'false', 'ignore_case': 'true', 'no_word_sep': ''} pseudoplain_interior_main_attributes_dict = {'default': 'comment1', 'digit_re': '', 'escape': '\\', 'highlight_digits': 'false', 'ignore_case': 't...
""" some specific bubble sort """ def bubble_sort(arr): times = 0 for i_index in range(len(arr)-1): j = 0 changed = False while j < len(arr)-1: if arr[j] > arr[j + 1]: arr[j], arr[j+1] = arr[j+1], arr[j] changed, times = True, times+1 ...
""" some specific bubble sort """ def bubble_sort(arr): times = 0 for i_index in range(len(arr) - 1): j = 0 changed = False while j < len(arr) - 1: if arr[j] > arr[j + 1]: (arr[j], arr[j + 1]) = (arr[j + 1], arr[j]) (changed, times) = (True, t...
champName = ["Aatrox","Ahri","Akali","Alistar","Amumu","Anivia", "Annie","Ashe","AurelionSol","Azir","Bard","Blitzcrank", "Brand","Braum","Caitlyn","Camille","Cassiopeia","ChoGath", "Corki","Darius","Diana","DrMundo","Draven","Ekko", "Elise","Evelynn","Ezreal","Fiddle...
champ_name = ['Aatrox', 'Ahri', 'Akali', 'Alistar', 'Amumu', 'Anivia', 'Annie', 'Ashe', 'AurelionSol', 'Azir', 'Bard', 'Blitzcrank', 'Brand', 'Braum', 'Caitlyn', 'Camille', 'Cassiopeia', 'ChoGath', 'Corki', 'Darius', 'Diana', 'DrMundo', 'Draven', 'Ekko', 'Elise', 'Evelynn', 'Ezreal', 'Fiddlesticks', 'Fiora', 'Fizz', 'G...
def xml_body_p_parse(soup, abstract, keep_abstract): # we'll save each paragraph to a holding list then join at the end p_text = [] # keeping the abstract at the begining depending on the input if keep_abstract == True: if abstract != '' and abstract != None and abstract == abstract: ...
def xml_body_p_parse(soup, abstract, keep_abstract): p_text = [] if keep_abstract == True: if abstract != '' and abstract != None and (abstract == abstract): p_text.append(abstract) else: pass body = soup.find('body') if body: main = body.find_all(['article', 'com...
num_pl = int(input()) pl_list = input() gift_list = [] mius_list = [] i = 0 times = 0 while True: if(not(pl_list[i]==' ')): times += 1 if (times > num_pl): pl_list += pl_list[times-num_pl-1] if (i == 0 and times <= num_pl): gift_list.append(1) ...
num_pl = int(input()) pl_list = input() gift_list = [] mius_list = [] i = 0 times = 0 while True: if not pl_list[i] == ' ': times += 1 if times > num_pl: pl_list += pl_list[times - num_pl - 1] if i == 0 and times <= num_pl: gift_list.append(1) elif pl_list[i] ...
# Create variable a _____ # Create variable b _____ # Print out the sum of a and b _____________
_____ _____ _____________
class Thumbnails(): """This is the Factory Client Object that will call an instance of a text reader""" def __init__(self, imgSourcePath, thumbnailList, saveDir, resize_height=None, resize_width=None, tf_model_path=None, ocr_confidence=None, padding=None): '''The last 5 parameters resize_height, resize...
class Thumbnails: """This is the Factory Client Object that will call an instance of a text reader""" def __init__(self, imgSourcePath, thumbnailList, saveDir, resize_height=None, resize_width=None, tf_model_path=None, ocr_confidence=None, padding=None): """The last 5 parameters resize_height, resize_w...
coreimage = ximport("coreimage") canvas = coreimage.canvas(150, 150) def fractal(x, y, depth=64): z = complex(x, y) o = complex(0, 0) for i in range(depth): if abs(o) <= 2: o = o*o + z else: return i return 0 #default, black pixels = [] w = h = 150 for i in range(w): ...
coreimage = ximport('coreimage') canvas = coreimage.canvas(150, 150) def fractal(x, y, depth=64): z = complex(x, y) o = complex(0, 0) for i in range(depth): if abs(o) <= 2: o = o * o + z else: return i return 0 pixels = [] w = h = 150 for i in range(w): for j...
# Heaviside step function x = 3 theta = None if x < 0: theta = 0. elif x == 0: theta = 0.5 else: theta = 1. print("Theta(" + str(x) + ") = " + str(theta))
x = 3 theta = None if x < 0: theta = 0.0 elif x == 0: theta = 0.5 else: theta = 1.0 print('Theta(' + str(x) + ') = ' + str(theta))
# # PySNMP MIB module COLUBRIS-DEVICE-WDS-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/COLUBRIS-DEVICE-WDS-MIB # Produced by pysmi-0.3.4 at Wed May 1 12:25:51 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 ...
(octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (single_value_constraint, constraints_union, value_size_constraint, value_range_constraint, constraints_intersection) ...
age = int(input()) def drinks(drink): print(f"drink {drink}") if age <= 14: drinks("toddy") elif age <= 18: drinks("coke") elif age <= 21: drinks("beer") else: drinks("whisky")
age = int(input()) def drinks(drink): print(f'drink {drink}') if age <= 14: drinks('toddy') elif age <= 18: drinks('coke') elif age <= 21: drinks('beer') else: drinks('whisky')
# from https://stackoverflow.com/questions/1151658/python-hashable-dicts class HashableDict(dict): """ A hashable version of a dictionary, useful for when a function needs to be cached but uses a dict as an argument """ def __key(self): return tuple((k, self[k]) for k in sorted(self)) def __ha...
class Hashabledict(dict): """ A hashable version of a dictionary, useful for when a function needs to be cached but uses a dict as an argument """ def __key(self): return tuple(((k, self[k]) for k in sorted(self))) def __hash__(self): return hash(self.__key()) def __eq__(self, oth...
SECTION_SEPARATOR = "%" * 30 def get_required_node_edges(qualified_node_id, required_node_ids): node_requires = [ f"{required_node_id}-->{qualified_node_id}" for required_node_id in required_node_ids ] return "\n".join(node_requires) def get_icon(dict_value): icon = "" if "icon" i...
section_separator = '%' * 30 def get_required_node_edges(qualified_node_id, required_node_ids): node_requires = [f'{required_node_id}-->{qualified_node_id}' for required_node_id in required_node_ids] return '\n'.join(node_requires) def get_icon(dict_value): icon = '' if 'icon' in dict_value: i...
total_food = int(input()) total_food_grams = total_food * 1000 is_food_over = False command = input() while command != 'Adopted': eaten_food = int(command) total_food_grams -= eaten_food if total_food_grams < 0: is_food_over = True command = input() if is_food_over: print(f'Food is not ...
total_food = int(input()) total_food_grams = total_food * 1000 is_food_over = False command = input() while command != 'Adopted': eaten_food = int(command) total_food_grams -= eaten_food if total_food_grams < 0: is_food_over = True command = input() if is_food_over: print(f'Food is not enoug...
class Solution: def isInterleave(self, s1, s2, s3): """ :type s1: str :type s2: str :type s3: str :rtype: bool """ if len(s3) != len(s1) + len(s2): return False if len(s3) == 0 and len(s1) == 0 and len(s2) == 0: return True ...
class Solution: def is_interleave(self, s1, s2, s3): """ :type s1: str :type s2: str :type s3: str :rtype: bool """ if len(s3) != len(s1) + len(s2): return False if len(s3) == 0 and len(s1) == 0 and (len(s2) == 0): return True ...
# to get a string like this run: # openssl rand -hex 32 SECRET_KEY = "de45991397da83e674149beb168b17fde74ebd4a8d6ca65310aedc7a082d5309" ALGORITHM = "HS256" ACCESS_TOKEN_EXPIRE_MINUTES = 30
secret_key = 'de45991397da83e674149beb168b17fde74ebd4a8d6ca65310aedc7a082d5309' algorithm = 'HS256' access_token_expire_minutes = 30
#!/usr/bin/env python3 #ccpc20qhda gcd = lambda a,b: b if a==0 else gcd(b%a,a) t = int(input()) for i in range(t): m,n = list(map(int,input().split())) aa = m*(m-1) bb = (m+n)*(m+n-1) c = gcd(aa,bb) print('Case #%d: %d/%d'%(i+1,aa//c,bb//c))
gcd = lambda a, b: b if a == 0 else gcd(b % a, a) t = int(input()) for i in range(t): (m, n) = list(map(int, input().split())) aa = m * (m - 1) bb = (m + n) * (m + n - 1) c = gcd(aa, bb) print('Case #%d: %d/%d' % (i + 1, aa // c, bb // c))
class Room: def __init__(self, lw, rw, name=""): self.id = id(self) self.name = name self.leftWall = lw self.rightWall = rw self.P = 0 self.S = 0 self.W = 0 self.C = 0 self.parseFinish = False def getId(self): return self.id d...
class Room: def __init__(self, lw, rw, name=''): self.id = id(self) self.name = name self.leftWall = lw self.rightWall = rw self.P = 0 self.S = 0 self.W = 0 self.C = 0 self.parseFinish = False def get_id(self): return self.id ...
"""Docstring for the card.py module This module contains the Card class which can be used for creating multiple cards in a deck. """ class Card: """ A class to represent cards. Parameters ---------- suit : str The suit of the card rank : str The rank of the card Attribu...
"""Docstring for the card.py module This module contains the Card class which can be used for creating multiple cards in a deck. """ class Card: """ A class to represent cards. Parameters ---------- suit : str The suit of the card rank : str The rank of the card Attribut...
#!/usr/bin/python3 """ Reference: https://edabit.com/challenge/HTaZiWnsCGgehpgdr This challenge is as follows: Travelling through Europe one needs to pay attention to how the license plate in the given country is displayed. When crossing the border you need to park on the shoulder, unscrew the p...
""" Reference: https://edabit.com/challenge/HTaZiWnsCGgehpgdr This challenge is as follows: Travelling through Europe one needs to pay attention to how the license plate in the given country is displayed. When crossing the border you need to park on the shoulder, unscrew the plate, re-group the ...
''' @description: Some training parameters @author: liutaiting @lastEditors: liutaiting @Date: 2020-04-01 23:49:35 @LastEditTime: 2020-04-04 23:41:21 ''' EPOCHS = 5 BATCH_SIZE = 32 NUM_CLASSES = 7 image_width = 48 image_height = 48 channels = 1 model_dir = "image_classification_model.h5" train_dir = "dataset/train" va...
""" @description: Some training parameters @author: liutaiting @lastEditors: liutaiting @Date: 2020-04-01 23:49:35 @LastEditTime: 2020-04-04 23:41:21 """ epochs = 5 batch_size = 32 num_classes = 7 image_width = 48 image_height = 48 channels = 1 model_dir = 'image_classification_model.h5' train_dir = 'dataset/train' val...
class Generator(): """Virtual class for Generators.""" def generate_char(self, char): self.generate_basic_info(char) self.generate_characteristics(char) self.generate_status(char) self.generate_combact_stat(char) self.generate_skills(char) self.generate_weapons(ch...
class Generator: """Virtual class for Generators.""" def generate_char(self, char): self.generate_basic_info(char) self.generate_characteristics(char) self.generate_status(char) self.generate_combact_stat(char) self.generate_skills(char) self.generate_weapons(cha...
# Node 'Class' # # written by John C. Lusth, copyright 2012 # # not really an object, a node is an abstraction of # a two-element array the first slot holds the value # the second slot holds the next pointer # # VERSION 1.0 def NodeCreate(value,next): return [value,next] def NodeValue(n): return n[0] def NodeNext(n): ...
def node_create(value, next): return [value, next] def node_value(n): return n[0] def node_next(n): return n[1] def node_set_value(n, value): n[0] = value return value def node_set_next(n, next): n[1] = next return next def list_create(*args): items = None for i in range(len(arg...
# 01234567890123456789012345 letters = "abcdefghijklmnopqrstuvwxyz" backwards = letters[25:0:-1] # if I want to print z...a then in line 4 I should write : backwards = letters[25::-1], so the slicing starts printing from 25 backwards to the start INCLUDING the start # create a slice that produces the charact...
letters = 'abcdefghijklmnopqrstuvwxyz' backwards = letters[25:0:-1] print(letters[16:13:-1]) print(letters[4::-1]) print(letters[25:17:-1]) print(backwards) print(letters[-4:]) print(letters[-1:]) print(letters[:1]) print(letters[0])
""" This file is a part of My-PyChess application. In this file, we define heuristic constants required for the python chess engine. """ pawnEvalWhite = ( (0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), (8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0), (2.0, 2.0, 3.0, 5.0, 5.0, 3.0, 2.0, 2.0), (0.5, 0.5, 1...
""" This file is a part of My-PyChess application. In this file, we define heuristic constants required for the python chess engine. """ pawn_eval_white = ((0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), (8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0), (2.0, 2.0, 3.0, 5.0, 5.0, 3.0, 2.0, 2.0), (0.5, 0.5, 1.0, 2.5, 2.5, 1.0, 0.5, 0....
class Solution: def canFinish(self, numCourses: int, prerequisites: List[List[int]]) -> bool: def dfs(course,prerequisite,used): used.add(course) if prerequisites[1] not in used: dfs(prerequisites,prerequisites[1],used) used = set() used_1 = s...
class Solution: def can_finish(self, numCourses: int, prerequisites: List[List[int]]) -> bool: def dfs(course, prerequisite, used): used.add(course) if prerequisites[1] not in used: dfs(prerequisites, prerequisites[1], used) used = set() used_1 = set...
class Plugin(object): name = "base" description = "base plugin" def add_arguments(self, parser): pass
class Plugin(object): name = 'base' description = 'base plugin' def add_arguments(self, parser): pass
v, n = [int(x) for x in input().split()] total = v*n for i in range(1, 10): if i>=2: print(" ", end="") print((total*i+9)// 10, end="") print()
(v, n) = [int(x) for x in input().split()] total = v * n for i in range(1, 10): if i >= 2: print(' ', end='') print((total * i + 9) // 10, end='') print()
'''write a simple function to add two integers, demonstrate how to call the function with various inputs''' # call the function add, 2 and 3, print the result to the terminal # call the function add, 2 and 3, save the result as a variable
"""write a simple function to add two integers, demonstrate how to call the function with various inputs"""