content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
class FindSumPairs: def __init__(self, nums1: List[int], nums2: List[int]): self.nums1 = nums1 self.nums2 = nums2 self.count2 = Counter(nums2) def add(self, index: int, val: int) -> None: self.count2[self.nums2[index]] -= 1 self.nums2[index] += val self.count2[self.nums2[index]] += 1 def...
class Findsumpairs: def __init__(self, nums1: List[int], nums2: List[int]): self.nums1 = nums1 self.nums2 = nums2 self.count2 = counter(nums2) def add(self, index: int, val: int) -> None: self.count2[self.nums2[index]] -= 1 self.nums2[index] += val self.count2[s...
def main(request, response): name = request.GET.first("name") source_origin = request.headers.get("origin", None); response.headers.set("Set-Cookie", name + "=value") response.headers.set("Access-Control-Allow-Origin", source_origin) response.headers.set("Access-Control-Allow-Credentials", "true")
def main(request, response): name = request.GET.first('name') source_origin = request.headers.get('origin', None) response.headers.set('Set-Cookie', name + '=value') response.headers.set('Access-Control-Allow-Origin', source_origin) response.headers.set('Access-Control-Allow-Credentials', 'true')
__all__ = ("InputDataError",) class InputDataError(ValueError): pass
__all__ = ('InputDataError',) class Inputdataerror(ValueError): pass
# 04. Forum Topics line = input() forum_dict = {} # def unique(sequence): # seen = set() # return [x for x in sequence if not(x in seen or seen.add(x))] while not line == "filter": words = line.split(" -> ") topic = words[0] hashtags = words[1].split(", ") if topic not in forum_dict.keys(): ...
line = input() forum_dict = {} while not line == 'filter': words = line.split(' -> ') topic = words[0] hashtags = words[1].split(', ') if topic not in forum_dict.keys(): forum_dict[topic] = hashtags else: forum_dict[topic].extend(hashtags) line = input() sequence = set(input().sp...
n=int(input())%2 if n==0: print("White") else: print("Black")
n = int(input()) % 2 if n == 0: print('White') else: print('Black')
{ 'targets' : [ { 'target_name' : 'hdfs3_bindings', 'sources' : [ 'src/addon.cc', 'src/HDFileSystem.cc', 'src/HDFile.cc' ], 'xcode_settings': { 'OTHER_CFLAGS': ['-Wno-unused-parameter', '-Wno-unus...
{'targets': [{'target_name': 'hdfs3_bindings', 'sources': ['src/addon.cc', 'src/HDFileSystem.cc', 'src/HDFile.cc'], 'xcode_settings': {'OTHER_CFLAGS': ['-Wno-unused-parameter', '-Wno-unused-result']}, 'cflags': ['-Wall', '-Wextra', '-Wno-unused-parameter', '-Wno-unused-result'], 'include_dirs': ['<!(node -e "require(\'...
expected_output = { "max_num_of_service_instances": 32768, "service_instance": { 2051: { "pkts_out": 0, "pkts_in": 0, "interface": "GigabitEthernet0/0/5", "bytes_in": 0, "bytes_out": 0, }, 2052: { "pkts_out": 0, ...
expected_output = {'max_num_of_service_instances': 32768, 'service_instance': {2051: {'pkts_out': 0, 'pkts_in': 0, 'interface': 'GigabitEthernet0/0/5', 'bytes_in': 0, 'bytes_out': 0}, 2052: {'pkts_out': 0, 'pkts_in': 0, 'interface': 'GigabitEthernet0/0/5', 'bytes_in': 0, 'bytes_out': 0}, 2053: {'pkts_out': 0, 'pkts_in'...
def lazy_property(fn): """ Convert function into a property where the function is only called the first time the property is accessed """ varName = "__{0}".format(fn.__name__) def lazyLoad(self): if not hasattr(self, varName): setattr(self, varName, fn(self)) re...
def lazy_property(fn): """ Convert function into a property where the function is only called the first time the property is accessed """ var_name = '__{0}'.format(fn.__name__) def lazy_load(self): if not hasattr(self, varName): setattr(self, varName, fn(self)) return g...
STD_GAS_PRICE = int(3e9) # 3gwei def autofund_account(web3, address, value): """ Automatically fund an account """ assert isinstance(value, int) net_id = int(web3.net.version) balance = web3.eth.getBalance(address) if net_id > 100: # If this is the test network, make sure our deployment...
std_gas_price = int(3000000000.0) def autofund_account(web3, address, value): """ Automatically fund an account """ assert isinstance(value, int) net_id = int(web3.net.version) balance = web3.eth.getBalance(address) if net_id > 100: if balance == 0: tx = web3.eth.sendTransaction...
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
""" Project Name: 'lan-map' Version: 0.1 Description: Network map creation application Ihor Cheberiak (c) 2021 https://www.linkedin.com/in/ihor-cheberiak/ """ class Buttonmainwindow: def __init__(self, main_gui) -> None: self.main_window = main_gui def button_new_device(self) -> None: self....
# Generated by h2py from /usr/include/sys/socket.h NC_TPI_CLTS = 1 NC_TPI_COTS = 2 NC_TPI_COTS_ORD = 3 NC_TPI_RAW = 4 SOCK_STREAM = NC_TPI_COTS SOCK_DGRAM = NC_TPI_CLTS SOCK_RAW = NC_TPI_RAW SOCK_RDM = 5 SOCK_SEQPACKET = 6 SO_DEBUG = 0x0001 SO_ACCEPTCONN = 0x0002 SO_REUSEADDR = 0x0004 SO_KEEPALIVE = 0x0008 SO_DONTROUTE...
nc_tpi_clts = 1 nc_tpi_cots = 2 nc_tpi_cots_ord = 3 nc_tpi_raw = 4 sock_stream = NC_TPI_COTS sock_dgram = NC_TPI_CLTS sock_raw = NC_TPI_RAW sock_rdm = 5 sock_seqpacket = 6 so_debug = 1 so_acceptconn = 2 so_reuseaddr = 4 so_keepalive = 8 so_dontroute = 16 so_broadcast = 32 so_useloopback = 64 so_linger = 128 so_oobinlin...
""" Write an algorithm to determine if a number n is happy. A happy number is a number defined by the following process: - Starting with any positive integer, replace the number by the sum of the squares of its digits. - Repeat the process until the number equals 1 (where it will stay), or it loops endlessly in a cycl...
""" Write an algorithm to determine if a number n is happy. A happy number is a number defined by the following process: - Starting with any positive integer, replace the number by the sum of the squares of its digits. - Repeat the process until the number equals 1 (where it will stay), or it loops endlessly in a cycl...
pkgname = "xev" pkgver = "1.2.4" pkgrel = 0 build_style = "gnu_configure" hostmakedepends = ["pkgconf"] makedepends = ["libxrandr-devel"] pkgdesc = "Display X events" maintainer = "q66 <q66@chimera-linux.org>" license = "MIT" url = "https://xorg.freedesktop.org" source = f"$(XORG_SITE)/app/{pkgname}-{pkgver}.tar.bz2" s...
pkgname = 'xev' pkgver = '1.2.4' pkgrel = 0 build_style = 'gnu_configure' hostmakedepends = ['pkgconf'] makedepends = ['libxrandr-devel'] pkgdesc = 'Display X events' maintainer = 'q66 <q66@chimera-linux.org>' license = 'MIT' url = 'https://xorg.freedesktop.org' source = f'$(XORG_SITE)/app/{pkgname}-{pkgver}.tar.bz2' s...
""" These settings are only needed if you are planning to push to S3, GitHub or data.world. If you only are only saving to local files, then these are not needed. """ S3_BUCKETS = { # 'bucket': name of the bucket # 'key': syntax: a_folder/another_folder # # For the 'scrub' bucket, one sub-folder named ...
""" These settings are only needed if you are planning to push to S3, GitHub or data.world. If you only are only saving to local files, then these are not needed. """ s3_buckets = {'scrub': {'bucket': 'THE_PUBLIC_BUCKET_TO_SAVE_TO', 'key': 'THE_DIRECTORY_TO_SAVE_TO'}, 'raw': {'bucket': 'THE_PRIVATE_BUCKET_TO_SAVE_TO', ...
class SectionModel(Query): def __init__(self, db): self.db = db self.table_name = "section" super(SectionModel, self).__init__()
class Sectionmodel(Query): def __init__(self, db): self.db = db self.table_name = 'section' super(SectionModel, self).__init__()
funcs = [ "abs", "all", "any", "ascii", "bin", "callable", "chr", "compile", "delattr", "dir", "divmod", "eval", "exec", "exit", "format", "getattr", "globals", "hasattr", "hash", "help", "hex", "id", "input", "isinstance", "issubclass", "iter", "len", "locals", "max", "min", "next", "oct", "open", ...
funcs = ['abs', 'all', 'any', 'ascii', 'bin', 'callable', 'chr', 'compile', 'delattr', 'dir', 'divmod', 'eval', 'exec', 'exit', 'format', 'getattr', 'globals', 'hasattr', 'hash', 'help', 'hex', 'id', 'input', 'isinstance', 'issubclass', 'iter', 'len', 'locals', 'max', 'min', 'next', 'oct', 'open', 'ord', 'pow', 'print'...
# # PySNMP MIB module CISCO-STP-EXTENSIONS-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-STP-EXTENSIONS-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 17:56:28 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7....
(integer, octet_string, object_identifier) = mibBuilder.importSymbols('ASN1', 'Integer', 'OctetString', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_size_constraint, single_value_constraint, constraints_union, value_range_constraint, constraints_intersection) ...
class ParseException(Exception): pass class RollbackException(Exception): pass
class Parseexception(Exception): pass class Rollbackexception(Exception): pass
lista=[] datos=int(input("Ingrese numero de datos: ")) for i in range(0,datos): alt=float(input("Ingrese las alturas: ")) lista.append(alt) print("La altura maxima es: ", max(lista))
lista = [] datos = int(input('Ingrese numero de datos: ')) for i in range(0, datos): alt = float(input('Ingrese las alturas: ')) lista.append(alt) print('La altura maxima es: ', max(lista))
# # Building script for ipcamera application # { 'includes': ['build/common.gypi'], 'targets' : [ { 'target_name': 'camerartc', 'type': 'executable', 'include_dirs': [ '../third_party/webrtc/modules/interface', ], 'dependencies': [ 'libjing...
{'includes': ['build/common.gypi'], 'targets': [{'target_name': 'camerartc', 'type': 'executable', 'include_dirs': ['../third_party/webrtc/modules/interface'], 'dependencies': ['libjingle.gyp:libjingle_peerconnection', '<(DEPTH)/third_party/jsoncpp/jsoncpp.gyp:jsoncpp'], 'sources': ['camerartc/main.cpp', 'camerartc/pee...
# -*- coding: utf-8 -*- def test_del_first_group(app): app.session.login(username = "admin", password = "secret") app.group.delete_first_group() app.session.logout()
def test_del_first_group(app): app.session.login(username='admin', password='secret') app.group.delete_first_group() app.session.logout()
class DataNotFound(RuntimeError): pass class DataError(RuntimeError): pass class InvalidAge(RuntimeError): pass class InvalidMeasurement(RuntimeError): pass
class Datanotfound(RuntimeError): pass class Dataerror(RuntimeError): pass class Invalidage(RuntimeError): pass class Invalidmeasurement(RuntimeError): pass
# check modulo matches python definition # this tests compiler constant folding print(123 % 7) print(-123 % 7) print(123 % -7) print(-123 % -7) a = 321 b = 19 print(a % b) print(a % -b) print(-a % b) print(-a % -b) a = 987654321987987987987987987987 b = 19 print(a % b) print(a % -b) print(-a % b) print(-a % -b)
print(123 % 7) print(-123 % 7) print(123 % -7) print(-123 % -7) a = 321 b = 19 print(a % b) print(a % -b) print(-a % b) print(-a % -b) a = 987654321987987987987987987987 b = 19 print(a % b) print(a % -b) print(-a % b) print(-a % -b)
class Judge: def __init__(self, trial, comparator): self.trial = trial self.comparator = comparator def judge(self, inputs, default): results = {input: self.trial(input) for input in inputs} eligible = {input: result for input, result in results.items() if result is not None} ...
class Judge: def __init__(self, trial, comparator): self.trial = trial self.comparator = comparator def judge(self, inputs, default): results = {input: self.trial(input) for input in inputs} eligible = {input: result for (input, result) in results.items() if result is not None}...
class Solution: def rob(self, nums: List[int]) -> int: if len(nums) == 0: return 0 elif len(nums) == 1: return nums[0] elif len(nums) == 2: return max(nums[0], nums[1]) scores = [0] * len(nums) scores[0] = nums[0] scores[1] = n...
class Solution: def rob(self, nums: List[int]) -> int: if len(nums) == 0: return 0 elif len(nums) == 1: return nums[0] elif len(nums) == 2: return max(nums[0], nums[1]) scores = [0] * len(nums) scores[0] = nums[0] scores[1] = nums[...
class BinarySearchTree: class Node: def __init__(self, value): self.left = None self.right = None self.value = value def __init__(self): self.root = None def add(self, value): if self.root: self._add(value, self.root) ...
class Binarysearchtree: class Node: def __init__(self, value): self.left = None self.right = None self.value = value def __init__(self): self.root = None def add(self, value): if self.root: self._add(value, self.root) else: ...
# noinspection PyUnusedLocal def fizz_buzz(number): strings = [] numstring = str(number) # fizz if divisible by 3 or has a 3 in it if (number % 3 == 0) or ("3" in numstring): strings.append("fizz") # buzz if divisible by 5 or it has a 5 in it: if (number % 5 == 0) or ("5" in numstring): ...
def fizz_buzz(number): strings = [] numstring = str(number) if number % 3 == 0 or '3' in numstring: strings.append('fizz') if number % 5 == 0 or '5' in numstring: strings.append('buzz') '\n Deluxe if div by 3 and contains a 3\n or div by 5 and contains a 5\n still fake delux...
# program to find whether it contains an additive sequence or not. class Solution(object): # DFS: iterative implement. def is_additive_number(self, num): length = len(num) for i in range(1, int(length/2+1)): for j in range(1, int((length-i)/2 + 1)): first, second, others ...
class Solution(object): def is_additive_number(self, num): length = len(num) for i in range(1, int(length / 2 + 1)): for j in range(1, int((length - i) / 2 + 1)): (first, second, others) = (num[:i], num[i:i + j], num[i + j:]) if self.isValid(first, second...
class Solution: def backspaceCompare(self, S: str, T: str) -> bool: s = []; t = [] for i in range(len(S)): if S[i] == "#": if len(s) > 0: s.pop(-1) else: s.append(S[i]) for i in range(len(T)): if T[i] == ...
class Solution: def backspace_compare(self, S: str, T: str) -> bool: s = [] t = [] for i in range(len(S)): if S[i] == '#': if len(s) > 0: s.pop(-1) else: s.append(S[i]) for i in range(len(T)): if...
N = int(input()) before = input() after = input() if N % 2 == 0: print("Deletion succeeded" if before == after else "Deletion failed") else: find = True for i in range(len(before)): if before[i] == after[i]: find = False break print("Deletion succeeded" if find else "Del...
n = int(input()) before = input() after = input() if N % 2 == 0: print('Deletion succeeded' if before == after else 'Deletion failed') else: find = True for i in range(len(before)): if before[i] == after[i]: find = False break print('Deletion succeeded' if find else 'Dele...
class Actor: def __init__(self, sess, learning_rate,action_dim,action_bound): self.sess = sess self.action_dim = action_dim self.action_bound = action_bound self.learning_rate = learning_rate # input current state, output action to be taken self.a = self.build_neural...
class Actor: def __init__(self, sess, learning_rate, action_dim, action_bound): self.sess = sess self.action_dim = action_dim self.action_bound = action_bound self.learning_rate = learning_rate self.a = self.build_neural_network(S, scope='eval_nn', trainable=True) se...
""" PlotPlayer Validators Subpackage contains various modules to support input and type validations. Public Modules: * type_validation - Contains methods to validating various types """
""" PlotPlayer Validators Subpackage contains various modules to support input and type validations. Public Modules: * type_validation - Contains methods to validating various types """
class ParserError(Exception): pass
class Parsererror(Exception): pass
r = int(input()) w = [int(x) for x in input().split()] c = [int(x) for x in input().split()] m = [0] for i in range(1, r + 1): m.append(max([x[0] + m[i - x[1]] for x in zip(c, w) if x[1] <= i], default = 0)) print(m)
r = int(input()) w = [int(x) for x in input().split()] c = [int(x) for x in input().split()] m = [0] for i in range(1, r + 1): m.append(max([x[0] + m[i - x[1]] for x in zip(c, w) if x[1] <= i], default=0)) print(m)
'''"Template" day module for AoC 2015''' def run(args): print(f'day0: {args}')
""""Template" day module for AoC 2015""" def run(args): print(f'day0: {args}')
''' @Author: Hata @Date: 2020-07-26 03:41:32 @LastEditors: Hata @LastEditTime: 2020-07-28 21:31:17 @FilePath: \LeetCode\116.py @Description: https://leetcode-cn.com/problems/populating-next-right-pointers-in-each-node/ ''' class Solution: def connect(self, root: 'Node') -> 'Node': if root is None: ...
""" @Author: Hata @Date: 2020-07-26 03:41:32 @LastEditors: Hata @LastEditTime: 2020-07-28 21:31:17 @FilePath: \\LeetCodeN.py @Description: https://leetcode-cn.com/problems/populating-next-right-pointers-in-each-node/ """ class Solution: def connect(self, root: 'Node') -> 'Node': if root is None: ...
name = "boost" version = "1.61.0" authors = [ "Beman Dawes", "David Abrahams" ] description = \ """ Boost is a set of libraries for the C++ programming language that provide support for tasks and structures such as linear algebra, pseudorandom number generation, multithreading, image processing, ...
name = 'boost' version = '1.61.0' authors = ['Beman Dawes', 'David Abrahams'] description = '\n Boost is a set of libraries for the C++ programming language that provide support for tasks and structures such\n as linear algebra, pseudorandom number generation, multithreading, image processing, regular expressions...
class Solution: # Iterative def invertTree(self, root: Optional[TreeNode]) -> Optional[TreeNode]: if not root: return None stack = [root] while len(stack) > 0: currentNode = stack.pop() currentNode.left, currentNode.right = currentNode.right,...
class Solution: def invert_tree(self, root: Optional[TreeNode]) -> Optional[TreeNode]: if not root: return None stack = [root] while len(stack) > 0: current_node = stack.pop() (currentNode.left, currentNode.right) = (currentNode.right, currentNode.left) ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # A perfect number is a number for which the sum of its proper divisors is exactly equal to the number. For example, the sum of the proper divisors of 28 would be 1 + 2 + 4 + 7 + 14 = 28, which means that 28 is a perfect number. # A number n is called deficient if the sum...
class Abundant: def __init__(self): self.abundants = [] def generate_abindant_numbers(self, maxValue): for number in range(maxValue): if number % 1000 == 0: print('GEN: itt jarunk:', number) total = 0 for divisor in range(1, number / 2 + 1): ...
def returnHazards(map): hazards = [] for x_index, x in enumerate(map): for y_index, y in enumerate(x): if y == 'x': hazards.append({"x":x_index,"y":y_index}) return hazards
def return_hazards(map): hazards = [] for (x_index, x) in enumerate(map): for (y_index, y) in enumerate(x): if y == 'x': hazards.append({'x': x_index, 'y': y_index}) return hazards
# Codechef June2020 # PRICECON # https://www.codechef.com/problems/PRICECON # Chef and Price Control """ Chef has N items in his shop (numbered 1 through N); for each valid i, the price of the i-th item is Pi. Since Chef has very loyal customers, all N items are guaranteed to be sold regardless of their price. Howe...
""" Chef has N items in his shop (numbered 1 through N); for each valid i, the price of the i-th item is Pi. Since Chef has very loyal customers, all N items are guaranteed to be sold regardless of their price. However, the government introduced a price ceiling K, which means that for each item i such that Pi>K, its ...
# # set up logging # from config import logging # logger = logging.getLogger(__name__) # import re class Criterion: """A set of conditions for matching Actions against PRAW objects""" def __init__(self, values): # convert the dict to attributes self.conditions = values self.modifier...
class Criterion: """A set of conditions for matching Actions against PRAW objects""" def __init__(self, values): self.conditions = values self.modifiers = dict() target_syntax = re.compile('^(?P<targets>[a-z0-9\\_\\+]+)(?P<modifiers>\\([a-z0-9\\_,]*\\))?$') for (k, v) in self.co...
result = 0 boxIds = [] with open("input.txt", "r") as input: for line in input: line = line.strip() boxIds.append(line) count2 = 0 count3 = 0 for boxId in boxIds: flag2 = True flag3 = True for c in set(boxId): n = boxId.count(c) if n == 2 and flag2: count2 +...
result = 0 box_ids = [] with open('input.txt', 'r') as input: for line in input: line = line.strip() boxIds.append(line) count2 = 0 count3 = 0 for box_id in boxIds: flag2 = True flag3 = True for c in set(boxId): n = boxId.count(c) if n == 2 and flag2: count2 +...
class Solution(object): def XXX(self, n): g5=5**0.5 b=(((1+g5)/2)**(n+1)-((1-g5)/2)**(n+1))/g5 return int(round(b))
class Solution(object): def xxx(self, n): g5 = 5 ** 0.5 b = (((1 + g5) / 2) ** (n + 1) - ((1 - g5) / 2) ** (n + 1)) / g5 return int(round(b))
"""Created by sgoswami on 7/18/17.""" """Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, determine if s can be segmented into a space-separated sequence of one or more dictionary words. You may assume the dictionary does not contain duplicate words. For example, given s = ...
"""Created by sgoswami on 7/18/17.""" 'Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, determine if s can be \nsegmented into a space-separated sequence of one or more dictionary words. You may assume the dictionary does not \ncontain duplicate words.\n\nFor example, given\ns ...
names = [] addr = 0x148 + 0x4E4 while addr <= 0x148 + 0x7FC: names.append('\t' + Name(Dword(addr)) + ' = ') addr += 8 with open('names.txt', 'w') as f: f.write('\n'.join(names))
names = [] addr = 328 + 1252 while addr <= 328 + 2044: names.append('\t' + name(dword(addr)) + ' = ') addr += 8 with open('names.txt', 'w') as f: f.write('\n'.join(names))
# Defines sample_keymap_string and sample_keymap_bytes # Python 2 type Python 3 type # sample_keymap_string unicode str # sample_keymap_bytes str bytes # This sample keymap is the output of xkbcomp :0 [filename] on my # system - it wasn't chosen for any other...
sample_keymap_string = '\nxkb_keymap {\nxkb_keycodes "evdev+aliases(qwerty)" {\n minimum = 8;\n maximum = 255;\n <ESC> = 9;\n <AE01> = 10;\n <AE02> = 11;\n <AE03> = 12;\n <AE04> = 13;\n <AE05> = 14;\n <AE06> = 15;\n <AE07> = 16;\n <AE08> = 17;\n <AE09> = 18;\n <AE10> = 19;\n <...
prenom = input("Votre prenom svp ") langue = input("Votre langue: ") # Langue devait etre "francais" ou "anglais" if langue == "francais": print("Bonjour %s" % prenom) elif langue == "anglais": print("Hello %s" % prenom) else: print("ERREUR")
prenom = input('Votre prenom svp ') langue = input('Votre langue: ') if langue == 'francais': print('Bonjour %s' % prenom) elif langue == 'anglais': print('Hello %s' % prenom) else: print('ERREUR')
""" Day 1 Solutions """ def part1(input_lines): """ The captcha requires you to review a sequence of digits (your puzzle input) and find the sum of all digits that match the next digit in the list. The list is circular, so the digit after the last digit is the first digit in the list. For example...
""" Day 1 Solutions """ def part1(input_lines): """ The captcha requires you to review a sequence of digits (your puzzle input) and find the sum of all digits that match the next digit in the list. The list is circular, so the digit after the last digit is the first digit in the list. For example:...
"""Top-level package for deployer-fsm.""" __author__ = """Luke Smith""" __email__ = 'lsmith@zenoscave.com' __version__ = '0.1.5'
"""Top-level package for deployer-fsm.""" __author__ = 'Luke Smith' __email__ = 'lsmith@zenoscave.com' __version__ = '0.1.5'
class Solution: # @param A : list of list of integers # @return an integer def cnt(self, A, mid): l = 0 r = len(A)-1 while l <= r: m = (l+r)//2 if A[m] <= mid: l = m+1 else: r = m-1 return l def findMed...
class Solution: def cnt(self, A, mid): l = 0 r = len(A) - 1 while l <= r: m = (l + r) // 2 if A[m] <= mid: l = m + 1 else: r = m - 1 return l def find_median(self, A): l = 1 r = 1000000000 ...
# raider.io api configuration RIO_MAX_PAGE = 5 # need to update in templates/stats_table.html # need to update in templates/compositions.html # need to update in templates/navbar.html RIO_SEASON = "season-sl-3" WCL_SEASON = 3 WCL_PARTITION = 1 # config RAID_NAME = "Sepulcher of the First Ones" # for heroic week,...
rio_max_page = 5 rio_season = 'season-sl-3' wcl_season = 3 wcl_partition = 1 raid_name = 'Sepulcher of the First Ones' min_key_level = 16 max_raid_difficulty = 'Mythic'
__all__ = [ 'plotting', 'misc', 'colors', 'tables', 'nodes', 'containers', 'values', 'basic', 'textures', 'drawing', ] __version__ = '1.1.1'
__all__ = ['plotting', 'misc', 'colors', 'tables', 'nodes', 'containers', 'values', 'basic', 'textures', 'drawing'] __version__ = '1.1.1'
''' Q: Popular star patterns Pattern 1: * ** *** **** ***** ****** Pattern 2: * * * * * * * * * * * * * * * * * * * * * Pattern 3: * *** ***** ******* ********* Pattern 4: * ...
""" Q: Popular star patterns Pattern 1: * ** *** **** ***** ****** Pattern 2: * * * * * * * * * * * * * * * * * * * * * Pattern 3: * *** ***** ******* ********* Pattern 4: * ...
# 27. Remove Element # Python 3 # https://leetcode.com/problems/remove-element def removeElement(nums, val): """ :type nums: List[int] :type val: int :rtype: int """ nums[:] = [num for num in nums if num != val] return len(nums) numbers, value = [3, 2, 2, 3], 3 print('Length: {} |...
def remove_element(nums, val): """ :type nums: List[int] :type val: int :rtype: int """ nums[:] = [num for num in nums if num != val] return len(nums) (numbers, value) = ([3, 2, 2, 3], 3) print('Length: {} | Array: {}'.format(remove_element(numbers, value), numbers))
class Guild: __slots__ = ('id', 'name', 'icon', 'owner', 'client_is_owner', 'permissions', 'region', 'afk_channel', 'afk_timeout', 'verification_level', 'roles', 'emojis', 'system_channel', 'features', 'mfa_level', 'created', 'large', 'member_count', 'voice_states', 'members', 'chann...
class Guild: __slots__ = ('id', 'name', 'icon', 'owner', 'client_is_owner', 'permissions', 'region', 'afk_channel', 'afk_timeout', 'verification_level', 'roles', 'emojis', 'system_channel', 'features', 'mfa_level', 'created', 'large', 'member_count', 'voice_states', 'members', 'channels', 'max_members', 'vanity_url...
q_data = [ {"question": "Japan was part of the Allied Powers during World War I.", "correct_answer": "True", "incorrect_answers": ["False"]}, {"category": "History", "type": "boolean", "difficulty": "easy", "question": "The Tiananmen Square protests of 1989 were held in H...
q_data = [{'question': 'Japan was part of the Allied Powers during World War I.', 'correct_answer': 'True', 'incorrect_answers': ['False']}, {'category': 'History', 'type': 'boolean', 'difficulty': 'easy', 'question': 'The Tiananmen Square protests of 1989 were held in Hong Kong.', 'correct_answer': 'False', 'incorrect...
#GamePlay.py #Richard Greenbaum, Karson Daecher, Max Melamed """This module contains the functions needed to support pentago gameplay. A pentago gameboard is represented by a 6x6 2D array. Each location on the board is initialized to "" and is set to 0 or 1 when the player or the AI respectively places a marble o...
"""This module contains the functions needed to support pentago gameplay. A pentago gameboard is represented by a 6x6 2D array. Each location on the board is initialized to "" and is set to 0 or 1 when the player or the AI respectively places a marble on that location. Each array in the gameboard nested array represe...
def func(s): one = 0 zero = 0 for i in range(len(s)): if i > 0 and s[i] == s[i-1] : continue if s[i] == "1": one += 1 else : zero += 1 return min(one,zero) s = input() print(func(s))
def func(s): one = 0 zero = 0 for i in range(len(s)): if i > 0 and s[i] == s[i - 1]: continue if s[i] == '1': one += 1 else: zero += 1 return min(one, zero) s = input() print(func(s))
# n points def lerp_line(pt0, pt1, n): pts = [] for i in range(n + 1): t = i / float(n) pt = pt0 * t + pt1 * (1.0 - t) pts.append(pt) return pts def pole_to_lines(pt0, pt1, color=[0, 255, 0], n=20): lines = [] pts = lerp_line(pt0, pt1, n) for pt in pts: lines.ap...
def lerp_line(pt0, pt1, n): pts = [] for i in range(n + 1): t = i / float(n) pt = pt0 * t + pt1 * (1.0 - t) pts.append(pt) return pts def pole_to_lines(pt0, pt1, color=[0, 255, 0], n=20): lines = [] pts = lerp_line(pt0, pt1, n) for pt in pts: lines.append([pt[0],...
class MetaData: ''' convert to dynamically adding attributes by passing in **kwargs and setting each key value pair attention will need to be given for when this class is used in other processes to make sure they know the attributes that exists with each class however, not necessary just now ...
class Metadata: """ convert to dynamically adding attributes by passing in **kwargs and setting each key value pair attention will need to be given for when this class is used in other processes to make sure they know the attributes that exists with each class however, not necessary just now ...
# A non-empty zero-indexed array A consisting of N integers is given. # # A permutation is a sequence containing each element from 1 to N once, and # only once. # # For example, array A such that: # A = [4, 1, 3, 2] # is a permutation, but array A such that: # A = [4, 1, 3] # is not a permutation, because value...
def solution(A): n = len(A) if N == 1: if A[0] == 1: return 1 else: return 0 count = {} for i in range(N): if A[i] not in count: count[A[i]] = 0 count[A[i]] += 1 if count[A[i]] > 1: return 0 values = count.keys()...
while(True): jars = [int(x) for x in input().split()] if sum(jars) == 0: break if sum(jars) == 13: print("Never speak again.") elif jars[0] > jars[1]: print("To the convention.") elif jars[1] > jars[0]: print("Left beehind.") elif jars[1] == jars[0]: print...
while True: jars = [int(x) for x in input().split()] if sum(jars) == 0: break if sum(jars) == 13: print('Never speak again.') elif jars[0] > jars[1]: print('To the convention.') elif jars[1] > jars[0]: print('Left beehind.') elif jars[1] == jars[0]: print(...
DATE_PATTERNS = ["%d.%m.%Y", "%Y-%m-%d", "%y-%m-%d", "%Y-%m-%dT%H:%M:%S", "%Y-%m-%d %H:%M:%S", "%d.%m.%Y %H:%M"] DEFAULT_DICT_SHARE = 70 SUPPORTED_FILE_TYPES = ['xls', 'xlsx', 'csv', 'xml', 'json', 'jsonl', 'yaml', 'tsv', 'sql', 'bson'] DEFAULT_OPTIONS = {'encoding' : 'utf8', ...
date_patterns = ['%d.%m.%Y', '%Y-%m-%d', '%y-%m-%d', '%Y-%m-%dT%H:%M:%S', '%Y-%m-%d %H:%M:%S', '%d.%m.%Y %H:%M'] default_dict_share = 70 supported_file_types = ['xls', 'xlsx', 'csv', 'xml', 'json', 'jsonl', 'yaml', 'tsv', 'sql', 'bson'] default_options = {'encoding': 'utf8', 'delimiter': ',', 'limit': 1000}
''' This solution was submitted by Team: eyeCoders_UOP during ACES Coders v8 2020 Team lead: Rusiru Thushara thusharakart@gmail.com The solution runs in O(n) ''' def getline():return [float(x) for x in input().strip().split(' ')] c,e,n,s0 = getline() arr, lst = [], [] m = c/s0 for i in range(int(n)): x,s = ...
""" This solution was submitted by Team: eyeCoders_UOP during ACES Coders v8 2020 Team lead: Rusiru Thushara thusharakart@gmail.com The solution runs in O(n) """ def getline(): return [float(x) for x in input().strip().split(' ')] (c, e, n, s0) = getline() (arr, lst) = ([], []) m = c / s0 for i in range(in...
# TODO: Make this a relative path local_url = "/home/garrison/Code/blogengine/output" remote_url = "http://www.example.com" site_title = "My Vanilla Blog" site_description = "The really cool blog in which I write about stuff" copy_rst = False disqus_shortname = "mydisqusshortname"
local_url = '/home/garrison/Code/blogengine/output' remote_url = 'http://www.example.com' site_title = 'My Vanilla Blog' site_description = 'The really cool blog in which I write about stuff' copy_rst = False disqus_shortname = 'mydisqusshortname'
in_code = 'abcdefghijklmnopqrstuvwxyz' out_code = '9128645!@#$%^&*()/.,;:~|[]' code = str.maketrans(in_code, out_code) print('this is encrypted!'.translate(code))
in_code = 'abcdefghijklmnopqrstuvwxyz' out_code = '9128645!@#$%^&*()/.,;:~|[]' code = str.maketrans(in_code, out_code) print('this is encrypted!'.translate(code))
# Question:5 countNumber = input("Enter the string ") print ("Original string is : " + countNumber) res = len(countNumber.split()) print ("Number of words in string is : " + str(res))
count_number = input('Enter the string ') print('Original string is : ' + countNumber) res = len(countNumber.split()) print('Number of words in string is : ' + str(res))
class Solution: def isValid(self, s: str) -> bool: while '[]' in s or '()' in s or '{}' in s: s = s.replace('[]','').replace('()','').replace('{}','') return len(s) == 0 """ time: 10 min time: O(n) space: O(n) errors: lower case values/keys Have to use stack because 3 charactors open/c...
class Solution: def is_valid(self, s: str) -> bool: while '[]' in s or '()' in s or '{}' in s: s = s.replace('[]', '').replace('()', '').replace('{}', '') return len(s) == 0 '\ntime: 10 min\ntime: O(n)\nspace: O(n)\nerrors:\nlower case values/keys\nHave to use stack because 3 charactors...
class Solution: def __init__(self): self.result = None def findMax(self, root): if root == None: return 0 # find max for left and right node left = self.findMax(root.left) right = self.findMax(root.right) # can either go straight down i.e. from root...
class Solution: def __init__(self): self.result = None def find_max(self, root): if root == None: return 0 left = self.findMax(root.left) right = self.findMax(root.right) max_straight = max(max(left, right) + root.val, root.val) max_curved = max(left...
class DatasetVO: def __init__(self): self._id = None self._name = "" self._folder = "" self._description = "" self._data_type = "" self._size = 0 self._count = 0 @property def count(self): return self._count @count.setter def count(se...
class Datasetvo: def __init__(self): self._id = None self._name = '' self._folder = '' self._description = '' self._data_type = '' self._size = 0 self._count = 0 @property def count(self): return self._count @count.setter def count(s...
class TembaException(Exception): def __str__(self): return self.message class TembaConnectionError(TembaException): message = "Unable to connect to host" class TembaBadRequestError(TembaException): def __init__(self, errors): self.errors = errors def __str__(self): msgs = []...
class Tembaexception(Exception): def __str__(self): return self.message class Tembaconnectionerror(TembaException): message = 'Unable to connect to host' class Tembabadrequesterror(TembaException): def __init__(self, errors): self.errors = errors def __str__(self): msgs = []...
DEFAULT_WINDOW_SIZE = 32 DEFAULT_THRESHOLD_MIN_BASIC = 45.39 DEFAULT_THRESHOLD_MAX_BASIC = 46.0 DEFAULT_THRESHOLD_MIN_ABS = 50.32 DEFAULT_THRESHOLD_MAX_ABS = 52.96 DEFAULT_THRESHOLD_MIN_WITHOUT_GC = 11.28 DEFAULT_THRESHOLD_MAX_WITHOUT_GC = 11.42 DEFAULT_MEAN_GC = 0.46354823199323626 DEFAULT_MAX_EVALUE = 0.00445 DEFAULT...
default_window_size = 32 default_threshold_min_basic = 45.39 default_threshold_max_basic = 46.0 default_threshold_min_abs = 50.32 default_threshold_max_abs = 52.96 default_threshold_min_without_gc = 11.28 default_threshold_max_without_gc = 11.42 default_mean_gc = 0.46354823199323625 default_max_evalue = 0.00445 default...
# @desc Add a short description or instruction here. This will show up at the top of the exercise. def function_name(parameter): # give your function a name and parameter(s) # have it do stuff return # what does it return? This will be what the user types when they predict the result. def main(): ...
def function_name(parameter): return def main(): print(function_name(parameter1)) print(function_name(parameter2)) print(function_name(parameter3)) print(function_name(parameter4)) if __name__ == '__main__': main()
s = input() g1 = {} for i in range(1, len(s)): g1[s[i-1: i+1]] = g1.get(s[i-1: i+1], 0) + 1 s = input() g2 = set() for i in range(1, len(s)): g2.add(s[i-1: i+1]) print(sum([g1[g] for g in frozenset(g1.keys()) & g2]))
s = input() g1 = {} for i in range(1, len(s)): g1[s[i - 1:i + 1]] = g1.get(s[i - 1:i + 1], 0) + 1 s = input() g2 = set() for i in range(1, len(s)): g2.add(s[i - 1:i + 1]) print(sum([g1[g] for g in frozenset(g1.keys()) & g2]))
"""Defines LidarObject class. ---------------------------------------------------------------------------------------------------------- This file is part of Sim-ATAV project and licensed under MIT license. Copyright (c) 2018 Cumhur Erkan Tuncali, Georgios Fainekos, Danil Prokhorov, Hisahiro Ito, James Kapinski. For qu...
"""Defines LidarObject class. ---------------------------------------------------------------------------------------------------------- This file is part of Sim-ATAV project and licensed under MIT license. Copyright (c) 2018 Cumhur Erkan Tuncali, Georgios Fainekos, Danil Prokhorov, Hisahiro Ito, James Kapinski. For qu...
# Code Demo for 13 Lecture # Working with Python Strings # CIS 135 - Code Demo File # Lecture example showing string contatenation firstName = "Peter" lastName = "Parker" print("\nString Contcatenation in Pyton uses the + operator") print(f'First Name = {firstName}') print(f'Last Name = {lastName}') print(...
first_name = 'Peter' last_name = 'Parker' print('\nString Contcatenation in Pyton uses the + operator') print(f'First Name = {firstName}') print(f'Last Name = {lastName}') print("Peter Parker can be concatenated as 'firstName' + ' ' + 'lastName'") print('Hello,', firstName + ' ' + lastName) jjc = 'Joliet Junior College...
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2021/10/17 21:35 # @Author : jacson # @FileName: file_from_pycharm.py print("hello world!!!")
print('hello world!!!')
def percentual(qtde, total): return (100 * qtde) / total n = int(input()) c = r = s = 0 for i in range(n): val, tipo = input().split() qtde = int(val) if tipo == 'C': c += qtde if tipo == 'R': r += qtde if tipo == 'S': s += qtde total = c + r + s print('Total: {} c...
def percentual(qtde, total): return 100 * qtde / total n = int(input()) c = r = s = 0 for i in range(n): (val, tipo) = input().split() qtde = int(val) if tipo == 'C': c += qtde if tipo == 'R': r += qtde if tipo == 'S': s += qtde total = c + r + s print('Total: {} cobaias'...
# See: http://django-suit.readthedocs.org/en/develop/ SUIT_CONFIG = { # header 'ADMIN_NAME': 'Augeo', # 'HEADER_DATE_FORMAT': 'l, j. F Y', # 'HEADER_TIME_FORMAT': 'H:i', }
suit_config = {'ADMIN_NAME': 'Augeo'}
def convert(my_str): my_list = list(my_str.split(' ')) return my_list values = {} times = {} weights = {} ids = [] f = open('crime_scene.txt') my_lines = f.readlines() stripped_lines = [line.strip() for line in my_lines] f.close() N = int(stripped_lines[1]) w = int(convert(stripped_lines[0])[0])...
def convert(my_str): my_list = list(my_str.split(' ')) return my_list values = {} times = {} weights = {} ids = [] f = open('crime_scene.txt') my_lines = f.readlines() stripped_lines = [line.strip() for line in my_lines] f.close() n = int(stripped_lines[1]) w = int(convert(stripped_lines[0])[0]) t = int(convert...
class Command: def exec(self, ob): met = getattr(self, "on"+type(ob).__name__) return met(ob) def onNode(self, a): pass def onConnection(self, a): pass def onGenome(self, a): pass
class Command: def exec(self, ob): met = getattr(self, 'on' + type(ob).__name__) return met(ob) def on_node(self, a): pass def on_connection(self, a): pass def on_genome(self, a): pass
__all__ = ['interpolation_slicing_default_param'] def interpolation_slicing_default_param(key): """ Returns the default parameters with the specified key. """ if key in default_parameters: return default_parameters[key] else: raise ValueError('The parameter with key : ' + str(key) + ...
__all__ = ['interpolation_slicing_default_param'] def interpolation_slicing_default_param(key): """ Returns the default parameters with the specified key. """ if key in default_parameters: return default_parameters[key] else: raise value_error('The parameter with key : ' + str(key) + ' does...
FILTER_ACTION_ON_CHOICES = ( ('entry', 'On Entry'), ('exit', 'On Exit'), ) FILTER_ACTION_TYPE_CHOICES = ( ('eml', 'Send Email Notification'), ('sms', 'Send SMS Notification'), ('slk', 'Send Slack Notification'), ('cus', 'Custom Action'), ('drv', 'Derive Stream Action'), ('rpt', 'Report...
filter_action_on_choices = (('entry', 'On Entry'), ('exit', 'On Exit')) filter_action_type_choices = (('eml', 'Send Email Notification'), ('sms', 'Send SMS Notification'), ('slk', 'Send Slack Notification'), ('cus', 'Custom Action'), ('drv', 'Derive Stream Action'), ('rpt', 'Report Generation Action'), ('smry', 'Summar...
# countup.py # http://asu-compmethodsphysics-phy494.github.io/ASU-PHY494//2017/01/19/03_Introduction_to_Python_2/#the-while-loop tmax = 10. t, dt = 0, 2. while t <= tmax: print("time " + str(t)) t += dt print("Finished")
tmax = 10.0 (t, dt) = (0, 2.0) while t <= tmax: print('time ' + str(t)) t += dt print('Finished')
wordList = ['quail'] def isValidWord(word, hand, wordList): """ Returns True if word is in the wordList and is entirely composed of letters in the hand. Otherwise, returns False. Does not mutate hand or wordList. word: string hand: dictionary (string -> int) wordList: list of lowercase str...
word_list = ['quail'] def is_valid_word(word, hand, wordList): """ Returns True if word is in the wordList and is entirely composed of letters in the hand. Otherwise, returns False. Does not mutate hand or wordList. word: string hand: dictionary (string -> int) wordList: list of lowercase...
def func1(): """ ## Create a QA Task To reach the tasks and assignments repositories go to <a href="https://sdk-docs.dataloop.ai/en/latest/repositories.html#module-dtlpy.repositories.tasks" target="_blank">tasks</a> and <a href="https://sdk-docs.dataloop.ai/en/latest/repositories.html#module-dtlpy.reposito...
def func1(): """ ## Create a QA Task To reach the tasks and assignments repositories go to <a href="https://sdk-docs.dataloop.ai/en/latest/repositories.html#module-dtlpy.repositories.tasks" target="_blank">tasks</a> and <a href="https://sdk-docs.dataloop.ai/en/latest/repositories.html#module-dtlpy.reposito...
# https://leetcode.com/problems/partition-array-into-three-parts-with-equal-sum/ # Easy (47.22%) # Total Accepted: 2,951 # Total Submissions: 6,250 # beats 100.0% of python submissions class Solution(object): def canThreePartsEqualSum(self, A): """ :type A: List[int] :rtype: bool ...
class Solution(object): def can_three_parts_equal_sum(self, A): """ :type A: List[int] :rtype: bool """ s = sum(A) if s % 3 != 0: return False target = s / 3 (cur_s, p) = (0, 0) for (idx, n) in enumerate(A): cur_s += n ...
''' Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. Created on Apr 9, 2014 @author: dfleck ''' class MessageCache(list): ''' Holds a list of tuples (envelope, message) ''' def __contains__(self, otherEnvelope): #print("\...
""" Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. Created on Apr 9, 2014 @author: dfleck """ class Messagecache(list): """ Holds a list of tuples (envelope, message) """ def __contains__(self, otherEnvelope): for value in self: ...
class Request: def __init__(self): self.timeout = 5000 def get_params(self): return {} def get_body(self): return {}
class Request: def __init__(self): self.timeout = 5000 def get_params(self): return {} def get_body(self): return {}
a = ['a', 'b', 'c', 'd'] print("This is a list", a) print("It is", len(a), "elements length.") print("Let's check if element 'd' is in the list:", 'd' in a) print("This should be the maximun value of the list", max(a)) print("This should be the minnimun value of the list", min(a)) print("This is a list, item ...
a = ['a', 'b', 'c', 'd'] print('This is a list', a) print('It is', len(a), 'elements length.') print("Let's check if element 'd' is in the list:", 'd' in a) print('This should be the maximun value of the list', max(a)) print('This should be the minnimun value of the list', min(a)) print('This is a list, item by item: '...
def soft_update_network(target, source, tau): for target_param, source_param in zip(target.parameters(), source.parameters()): target_param.data.copy_( target_param.data * (1 - tau) + source_param.data * tau ) def hard_update_network(target, source): target.load_state_dict(source....
def soft_update_network(target, source, tau): for (target_param, source_param) in zip(target.parameters(), source.parameters()): target_param.data.copy_(target_param.data * (1 - tau) + source_param.data * tau) def hard_update_network(target, source): target.load_state_dict(source.state_dict())
class PropertyError(Exception): """Represents game property error.""" pass
class Propertyerror(Exception): """Represents game property error.""" pass
words = { 'i': 520, 'am': 100, 'batman': 20, 'hello': 100 } # iterate over keys # for key in words.keys(): # print(key) # for key in words: # print(key) # iterate over values # words_keys = words.keys() # print(words_keys) # words_values = words.values() # print(words_values) # for value i...
words = {'i': 520, 'am': 100, 'batman': 20, 'hello': 100} for (key, value) in words.items(): print(key, value)
SECRET = "very secret key" DEBUG = False LOG_FILE = "log" LOG_FORMAT = ''' Message type: %(levelname)s Location: %(pathname)s:%(lineno)d Module: %(module)s Function: %(funcName)s Time: %(asctime)s Message: %(message)s ''' SENDGRID_APIKEY = "BLAABLAA" RECEIPTS_FOL...
secret = 'very secret key' debug = False log_file = 'log' log_format = '\nMessage type: %(levelname)s\nLocation: %(pathname)s:%(lineno)d\nModule: %(module)s\nFunction: %(funcName)s\nTime: %(asctime)s\n\nMessage:\n\n%(message)s\n' sendgrid_apikey = 'BLAABLAA' receipts_...
CONTAINERS_DISCOVERY_LOCK_KEY = 'containers_discovery.lock' CONTAINERS_DISCOVERY_LAST_UPDATE_KEY = 'containers_discovery.last_update' CONTAINERS_DISCOVERY_DATA_KEY = 'containers_discovery.data' RESOURCES_DISCOVERY_LOCK_KEY = 'resources_discovery.lock' RESOURCES_DISCOVERY_LAST_UPDATE_KEY = 'resources_discovery.last_upd...
containers_discovery_lock_key = 'containers_discovery.lock' containers_discovery_last_update_key = 'containers_discovery.last_update' containers_discovery_data_key = 'containers_discovery.data' resources_discovery_lock_key = 'resources_discovery.lock' resources_discovery_last_update_key = 'resources_discovery.last_upda...
def assert_revision(revision, author=None, message=None): """Asserts values of the given fields in the provided revision. :param revision: The revision to validate :param author: that must be present in the ``revision`` :param message: message substring that must be present in ``revision`` """ ...
def assert_revision(revision, author=None, message=None): """Asserts values of the given fields in the provided revision. :param revision: The revision to validate :param author: that must be present in the ``revision`` :param message: message substring that must be present in ``revision`` """ ...
class ScraperFactoryException(Exception): pass class SpiderNotFoundError(ScraperFactoryException): pass class InvalidUrlError(ScraperFactoryException): pass
class Scraperfactoryexception(Exception): pass class Spidernotfounderror(ScraperFactoryException): pass class Invalidurlerror(ScraperFactoryException): pass
"""Functions for calculating biomass from TCH of canopy height models""" def longo2016_acd(top_of_canopy_height: float) -> float: """ Convert `top_of_canopy_height` (tch) to biomass according to the formula in Longo et al. 2016. Source: https://agupubs.onlinelibrary.wiley.com/action/downloadS...
"""Functions for calculating biomass from TCH of canopy height models""" def longo2016_acd(top_of_canopy_height: float) -> float: """ Convert `top_of_canopy_height` (tch) to biomass according to the formula in Longo et al. 2016. Source: https://agupubs.onlinelibrary.wiley.com/action/downloadSu...
class Solution: def findRelativeRanks(self, score: List[int]) -> List[str]: sorted_score = sorted(score,reverse=True) rankings = {} for i in range(len(sorted_score)): if i == 0: rankings[sorted_score[i]] = 'Gold Medal' elif i == 1: rankings[sorted_score[i]] = 'Silver ...
class Solution: def find_relative_ranks(self, score: List[int]) -> List[str]: sorted_score = sorted(score, reverse=True) rankings = {} for i in range(len(sorted_score)): if i == 0: rankings[sorted_score[i]] = 'Gold Medal' elif i == 1: ...