function stringlengths 18 3.86k | intent_category stringlengths 5 24 |
|---|---|
def is_square_form(num: int) -> bool:
digit = 9
while num > 0:
if num % 10 != digit:
return False
num //= 100
digit -= 1
return True | project_euler |
def solution() -> int:
num = 138902663
while not is_square_form(num * num):
if num % 10 == 3:
num -= 6 # (3 - 6) % 10 = 7
else:
num -= 4 # (7 - 4) % 10 = 3
return num * 10 | project_euler |
def sum_of_digit_factorial(n: int) -> int:
return sum(DIGIT_FACTORIAL[d] for d in str(n)) | project_euler |
def solution() -> int:
limit = 7 * factorial(9) + 1
return sum(i for i in range(3, limit) if sum_of_digit_factorial(i) == i) | project_euler |
def solution(n: int = 4000000) -> int:
if n <= 1:
return 0
a = 0
b = 2
count = 0
while 4 * b + a <= n:
a, b = b, 4 * b + a
count += a
return count + b | project_euler |
def solution(n: int = 4000000) -> int:
even_fibs = []
a, b = 0, 1
while b <= n:
if b % 2 == 0:
even_fibs.append(b)
a, b = b, a + b
return sum(even_fibs) | project_euler |
def solution(n: int = 4000000) -> int:
i = 1
j = 2
total = 0
while j <= n:
if j % 2 == 0:
total += j
i, j = j, i + j
return total | project_euler |
def solution(n: int = 4000000) -> int:
fib = [0, 1]
i = 0
while fib[i] <= n:
fib.append(fib[i] + fib[i + 1])
if fib[i + 2] > n:
break
i += 1
total = 0
for j in range(len(fib) - 1):
if fib[j] % 2 == 0:
total += fib[j]
return total | project_euler |
def solution(n: int = 4000000) -> int:
try:
n = int(n)
except (TypeError, ValueError):
raise TypeError("Parameter n must be int or castable to int.")
if n <= 0:
raise ValueError("Parameter n must be greater than or equal to one.")
getcontext().prec = 100
phi = (Decimal(5) **... | project_euler |
def greatest_common_divisor(x: int, y: int) -> int:
return x if y == 0 else greatest_common_divisor(y, x % y) | project_euler |
def lcm(x: int, y: int) -> int:
return (x * y) // greatest_common_divisor(x, y) | project_euler |
def solution(n: int = 20) -> int:
g = 1
for i in range(1, n + 1):
g = lcm(g, i)
return g | project_euler |
def solution(n: int = 20) -> int:
try:
n = int(n)
except (TypeError, ValueError):
raise TypeError("Parameter n must be int or castable to int.")
if n <= 0:
raise ValueError("Parameter n must be greater than or equal to one.")
i = 0
while 1:
i += n * (n - 1)
n... | project_euler |
def solution(min_block_length: int = 50) -> int:
fill_count_functions = [1] * min_block_length
for n in count(min_block_length):
fill_count_functions.append(1)
for block_length in range(min_block_length, n + 1):
for block_start in range(n - block_length):
fill_coun... | project_euler |
def check_bouncy(n: int) -> bool:
if not isinstance(n, int):
raise ValueError("check_bouncy() accepts only integer arguments")
str_n = str(n)
sorted_str_n = "".join(sorted(str_n))
return sorted_str_n != str_n and sorted_str_n[::-1] != str_n | project_euler |
def solution(percent: float = 99) -> int:
if not 0 < percent < 100:
raise ValueError("solution() only accepts values from 0 to 100")
bouncy_num = 0
num = 1
while True:
if check_bouncy(num):
bouncy_num += 1
if (bouncy_num / num) * 100 >= percent:
return nu... | project_euler |
def sieve() -> Generator[int, None, None]:
factor_map: dict[int, int] = {}
prime = 2
while True:
factor = factor_map.pop(prime, None)
if factor:
x = factor + prime
while x in factor_map:
x += factor
factor_map[x] = factor
else:
... | project_euler |
def solution(limit: float = 1e10) -> int:
primes = sieve()
n = 1
while True:
prime = next(primes)
if (2 * prime * n) > limit:
return n
# Ignore the next prime as the reminder will be 2.
next(primes)
n += 2 | project_euler |
def is_palindrome(n: int) -> bool:
if n % 10 == 0:
return False
s = str(n)
return s == s[::-1] | project_euler |
def solution() -> int:
answer = set()
first_square = 1
sum_squares = 5
while sum_squares < LIMIT:
last_square = first_square + 1
while sum_squares < LIMIT:
if is_palindrome(sum_squares):
answer.add(sum_squares)
last_square += 1
sum_squa... | project_euler |
def choose(n: int, r: int) -> int:
ret = 1.0
for i in range(1, r + 1):
ret *= (n + 1 - i) / i
return round(ret) | project_euler |
def non_bouncy_exact(n: int) -> int:
return choose(8 + n, n) + choose(9 + n, n) - 10 | project_euler |
def non_bouncy_upto(n: int) -> int:
return sum(non_bouncy_exact(i) for i in range(1, n + 1)) | project_euler |
def solution(num_digits: int = 100) -> int:
return non_bouncy_upto(num_digits) | project_euler |
def solution(length: int = 50) -> int:
ways_number = [1] * (length + 1)
for row_length in range(3, length + 1):
for block_length in range(3, row_length + 1):
for block_start in range(row_length - block_length):
ways_number[row_length] += ways_number[
row... | project_euler |
def solution(limit: int = 100) -> int:
singles: list[int] = [*list(range(1, 21)), 25]
doubles: list[int] = [2 * x for x in range(1, 21)] + [50]
triples: list[int] = [3 * x for x in range(1, 21)]
all_values: list[int] = singles + doubles + triples + [0]
num_checkouts: int = 0
double: int
thr... | project_euler |
def __init__(self, vertices: set[int], edges: Mapping[EdgeT, int]) -> None:
self.vertices: set[int] = vertices
self.edges: dict[EdgeT, int] = {
(min(edge), max(edge)): weight for edge, weight in edges.items()
} | project_euler |
def add_edge(self, edge: EdgeT, weight: int) -> None:
self.vertices.add(edge[0])
self.vertices.add(edge[1])
self.edges[(min(edge), max(edge))] = weight | project_euler |
def prims_algorithm(self) -> Graph:
subgraph: Graph = Graph({min(self.vertices)}, {})
min_edge: EdgeT
min_weight: int
edge: EdgeT
weight: int
while len(subgraph.vertices) < len(self.vertices):
min_weight = max(self.edges.values()) + 1
for edge, we... | project_euler |
def solution(filename: str = "p107_network.txt") -> int:
script_dir: str = os.path.abspath(os.path.dirname(__file__))
network_file: str = os.path.join(script_dir, filename)
edges: dict[EdgeT, int] = {}
data: list[str]
edge1: int
edge2: int
with open(network_file) as f:
data = f.read... | project_euler |
def solution(min_total: int = 10**12) -> int:
prev_numerator = 1
prev_denominator = 0
numerator = 1
denominator = 1
while numerator <= 2 * min_total - 1:
prev_numerator += 2 * numerator
numerator += 2 * prev_numerator
prev_denominator += 2 * denominator
denominato... | project_euler |
def _calculate(days: int, absent: int, late: int) -> int:
# if we are absent twice, or late 3 consecutive days,
# no further prize strings are possible
if late == 3 or absent == 2:
return 0
# if we have no days left, and have not failed any other rules,
# we have a prize string
if days... | project_euler |
def solution(days: int = 30) -> int:
return _calculate(days, absent=0, late=0) | project_euler |
def solve(matrix: Matrix, vector: Matrix) -> Matrix:
size: int = len(matrix)
augmented: Matrix = [[0 for _ in range(size + 1)] for _ in range(size)]
row: int
row2: int
col: int
col2: int
pivot_row: int
ratio: float
for row in range(size):
for col in range(size):
... | project_euler |
def interpolated_func(var: int) -> int:
return sum(
round(coeffs[x_val][0]) * (var ** (size - x_val - 1))
for x_val in range(size)
) | project_euler |
def question_function(variable: int) -> int:
return (
1
- variable
+ variable**2
- variable**3
+ variable**4
- variable**5
+ variable**6
- variable**7
+ variable**8
- variable**9
+ variable**10
) | project_euler |
def solution(func: Callable[[int], int] = question_function, order: int = 10) -> int:
data_points: list[int] = [func(x_val) for x_val in range(1, order + 1)]
polynomials: list[Callable[[int], int]] = [
interpolate(data_points[:max_coeff]) for max_coeff in range(1, order + 1)
]
ret: int = 0
... | project_euler |
def is_prime(number: int) -> bool:
if 1 < number < 4:
# 2 and 3 are primes
return True
elif number < 2 or number % 2 == 0 or number % 3 == 0:
# Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
return False
# All primes number are in format of 6k +/- 1
... | project_euler |
def solution(a_limit: int = 1000, b_limit: int = 1000) -> int:
longest = [0, 0, 0] # length, a, b
for a in range((a_limit * -1) + 1, a_limit):
for b in range(2, b_limit):
if is_prime(b):
count = 0
n = 0
while is_prime((n**2) + (a * n) + b):
... | project_euler |
def solution():
script_dir = os.path.dirname(os.path.realpath(__file__))
triangle = os.path.join(script_dir, "triangle.txt")
with open(triangle) as f:
triangle = f.readlines()
a = [[int(y) for y in x.rstrip("\r\n").split(" ")] for x in triangle]
for i in range(1, len(a)):
for j in... | project_euler |
def solution(num: int = 100) -> int:
return sum(map(int, str(factorial(num)))) | project_euler |
def solution(num: int = 100) -> int:
return sum(int(x) for x in str(factorial(num))) | project_euler |
def factorial(num: int) -> int:
sum_of_digits = 0
while number > 0:
last_digit = number % 10
sum_of_digits += last_digit
number = number // 10 # Removing the last_digit from the given number
return sum_of_digits | project_euler |
def solution(num: int = 100) -> int:
nfact = factorial(num)
result = split_and_add(nfact)
return result | project_euler |
def solution(num: int = 100) -> int:
fact = 1
result = 0
for i in range(1, num + 1):
fact *= i
for j in str(fact):
result += int(j)
return result | project_euler |
def solution(power: int = 1000) -> int:
n = 2**power
r = 0
while n:
r, n = r + n % 10, n // 10
return r | project_euler |
def solution(power: int = 1000) -> int:
num = 2**power
string_num = str(num)
list_num = list(string_num)
sum_of_num = 0
for i in list_num:
sum_of_num += int(i)
return sum_of_num | project_euler |
def solution(n: int = 100) -> int:
collect_powers = set()
current_pow = 0
n = n + 1 # maximum limit
for a in range(2, n):
for b in range(2, n):
current_pow = a**b # calculates the current power
collect_powers.add(current_pow) # adds the result to the set
return ... | project_euler |
def solution():
with open(os.path.dirname(__file__) + "/grid.txt") as f:
l = [] # noqa: E741
for _ in range(20):
l.append([int(x) for x in f.readline().split()])
maximum = 0
# right
for i in range(20):
for j in range(17):
temp = l[i]... | project_euler |
def largest_product(grid):
n_columns = len(grid[0])
n_rows = len(grid)
largest = 0
lr_diag_product = 0
rl_diag_product = 0
# Check vertically, horizontally, diagonally at the same time (only works
# for nxn grid)
for i in range(n_columns):
for j in range(n_rows - 3):
... | project_euler |
def solution():
grid = []
with open(os.path.dirname(__file__) + "/grid.txt") as file:
for line in file:
grid.append(line.strip("\n").split(" "))
grid = [[int(i) for i in grid[j]] for j in range(len(grid))]
return largest_product(grid) | project_euler |
def hexagonal_num(n: int) -> int:
return n * (2 * n - 1) | project_euler |
def is_pentagonal(n: int) -> bool:
root = (1 + 24 * n) ** 0.5
return ((1 + root) / 6) % 1 == 0 | project_euler |
def solution(start: int = 144) -> int:
n = start
num = hexagonal_num(n)
while not is_pentagonal(num):
n += 1
num = hexagonal_num(n)
return num | project_euler |
def parse_roman_numerals(numerals: str) -> int:
total_value = 0
index = 0
while index < len(numerals) - 1:
current_value = SYMBOLS[numerals[index]]
next_value = SYMBOLS[numerals[index + 1]]
if current_value < next_value:
total_value -= current_value
else:
... | project_euler |
def generate_roman_numerals(num: int) -> str:
numerals = ""
m_count = num // 1000
numerals += m_count * "M"
num %= 1000
c_count = num // 100
if c_count == 9:
numerals += "CM"
c_count -= 9
elif c_count == 4:
numerals += "CD"
c_count -= 4
if c_count >= 5:... | project_euler |
def solution(roman_numerals_filename: str = "/p089_roman.txt") -> int:
savings = 0
with open(os.path.dirname(__file__) + roman_numerals_filename) as file1:
lines = file1.readlines()
for line in lines:
original = line.strip()
num = parse_roman_numerals(original)
shortened =... | project_euler |
def solution():
script_dir = os.path.dirname(os.path.realpath(__file__))
words_file_path = os.path.join(script_dir, "words.txt")
words = ""
with open(words_file_path) as f:
words = f.readline()
words = [word.strip('"') for word in words.strip("\r\n").split(",")]
words = [
word
... | project_euler |
def solution() -> int:
answer = 0
decimal_context = decimal.Context(prec=105)
for i in range(2, 100):
number = decimal.Decimal(i)
sqrt_number = number.sqrt(decimal_context)
if len(str(sqrt_number)) > 1:
answer += int(str(sqrt_number)[0])
sqrt_number_str = str(... | project_euler |
def digit_factorial_sum(number: int) -> int:
if not isinstance(number, int):
raise TypeError("Parameter number must be int")
if number < 0:
raise ValueError("Parameter number must be greater than or equal to 0")
# Converts number in string to iterate on its digits and adds its factorial.
... | project_euler |
def solution(chain_length: int = 60, number_limit: int = 1000000) -> int:
if not isinstance(chain_length, int) or not isinstance(number_limit, int):
raise TypeError("Parameters chain_length and number_limit must be int")
if chain_length <= 0 or number_limit <= 0:
raise ValueError(
... | project_euler |
def sum_digit_factorials(n: int) -> int:
if n in CACHE_SUM_DIGIT_FACTORIALS:
return CACHE_SUM_DIGIT_FACTORIALS[n]
ret = sum(DIGIT_FACTORIALS[let] for let in str(n))
CACHE_SUM_DIGIT_FACTORIALS[n] = ret
return ret | project_euler |
def chain_length(n: int, previous: set | None = None) -> int:
previous = previous or set()
if n in CHAIN_LENGTH_CACHE:
return CHAIN_LENGTH_CACHE[n]
next_number = sum_digit_factorials(n)
if next_number in previous:
CHAIN_LENGTH_CACHE[n] = 0
return 0
else:
previous.add(... | project_euler |
def solution(num_terms: int = 60, max_start: int = 1000000) -> int:
return sum(1 for i in range(1, max_start) if chain_length(i) == num_terms) | project_euler |
def solution(max_d: int = 12_000) -> int:
fractions_number = 0
for d in range(max_d + 1):
for n in range(d // 3 + 1, (d + 1) // 2):
if gcd(n, d) == 1:
fractions_number += 1
return fractions_number | project_euler |
def solution(limit: int = 50000000) -> int:
ret = set()
prime_square_limit = int((limit - 24) ** (1 / 2))
primes = set(range(3, prime_square_limit + 1, 2))
primes.add(2)
for p in range(3, prime_square_limit + 1, 2):
if p not in primes:
continue
primes.difference_update(s... | project_euler |
def solution(n: int = 2000000) -> int:
primality_list = [0 for i in range(n + 1)]
primality_list[0] = 1
primality_list[1] = 1
for i in range(2, int(n**0.5) + 1):
if primality_list[i] == 0:
for j in range(i * i, n + 1, i):
primality_list[j] = 1
sum_of_primes = 0
... | project_euler |
def is_prime(number: int) -> bool:
if 1 < number < 4:
# 2 and 3 are primes
return True
elif number < 2 or number % 2 == 0 or number % 3 == 0:
# Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
return False
# All primes number are in format of 6k +/- 1
... | project_euler |
def prime_generator() -> Iterator[int]:
num = 2
while True:
if is_prime(num):
yield num
num += 1 | project_euler |
def solution(n: int = 2000000) -> int:
return sum(takewhile(lambda x: x < n, prime_generator())) | project_euler |
def is_prime(number: int) -> bool:
if 1 < number < 4:
# 2 and 3 are primes
return True
elif number < 2 or number % 2 == 0 or number % 3 == 0:
# Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
return False
# All primes number are in format of 6k +/- 1
... | project_euler |
def solution(n: int = 2000000) -> int:
return sum(num for num in range(3, n, 2) if is_prime(num)) + 2 if n > 2 else 0 | project_euler |
def solution(n: int = 1000) -> int:
# number of letters in zero, one, two, ..., nineteen (0 for zero since it's
# never said aloud)
ones_counts = [0, 3, 3, 5, 4, 4, 3, 5, 5, 4, 3, 6, 6, 8, 8, 7, 7, 9, 8, 8]
# number of letters in twenty, thirty, ..., ninety (0 for numbers less than
# 20 due to incon... | project_euler |
def solution(n: int = 1001) -> int:
total = 1
for i in range(1, int(ceil(n / 2.0))):
odd = 2 * i + 1
even = 2 * i
total = total + 4 * odd**2 - 6 * even
return total | project_euler |
def sum_of_divisors(n: int) -> int:
total = 0
for i in range(1, int(sqrt(n) + 1)):
if n % i == 0 and i != sqrt(n):
total += i + n // i
elif i == sqrt(n):
total += i
return total - n | project_euler |
def solution(n: int = 10000) -> int:
total = sum(
i
for i in range(1, n)
if sum_of_divisors(sum_of_divisors(i)) == i and sum_of_divisors(i) != i
)
return total | project_euler |
def solution(numerator: int = 1, digit: int = 1000) -> int:
the_digit = 1
longest_list_length = 0
for divide_by_number in range(numerator, digit + 1):
has_been_divided: list[int] = []
now_divide = numerator
for _ in range(1, digit + 1):
if now_divide in has_been_divided:... | project_euler |
def solution():
days_per_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
day = 6
month = 1
year = 1901
sundays = 0
while year < 2001:
day += 7
if (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0):
if day > days_per_month[month - 1] and month != 2:
... | project_euler |
def solution(limit: int = 1000000) -> int:
num_cuboids: int = 0
max_cuboid_size: int = 0
sum_shortest_sides: int
while num_cuboids <= limit:
max_cuboid_size += 1
for sum_shortest_sides in range(2, 2 * max_cuboid_size + 1):
if sqrt(sum_shortest_sides**2 + max_cuboid_size**2).... | project_euler |
def solution(limit: int = 1000000) -> int:
primes = set(range(3, limit, 2))
primes.add(2)
for p in range(3, limit, 2):
if p not in primes:
continue
primes.difference_update(set(range(p * p, limit, p)))
phi = [float(n) for n in range(limit + 1)]
for p in primes:
... | project_euler |
def solution(limit: int = 1_000_000) -> int:
phi = [i - 1 for i in range(limit + 1)]
for i in range(2, limit + 1):
if phi[i] == i - 1:
for j in range(2 * i, limit + 1, i):
phi[j] -= phi[j] // i
return sum(phi[2 : limit + 1]) | project_euler |
def solution(limit: int = 1500000) -> int:
frequencies: DefaultDict = defaultdict(int)
euclid_m = 2
while 2 * euclid_m * (euclid_m + 1) <= limit:
for euclid_n in range((euclid_m % 2) + 1, euclid_m, 2):
if gcd(euclid_m, euclid_n) > 1:
continue
primitive_perimet... | project_euler |
def solution(filename: str = "matrix.txt") -> int:
with open(os.path.join(os.path.dirname(__file__), filename)) as in_file:
data = in_file.read()
grid = [[int(cell) for cell in row.split(",")] for row in data.strip().splitlines()]
dp = [[0 for cell in row] for row in grid]
n = len(grid[0])
... | project_euler |
def is_substring_divisible(num: tuple) -> bool:
if num[3] % 2 != 0:
return False
if (num[2] + num[3] + num[4]) % 3 != 0:
return False
if num[5] % 5 != 0:
return False
tests = [7, 11, 13, 17]
for i, test in enumerate(tests):
if (num[i + 4] * 100 + num[i + 5] * 10 + ... | project_euler |
def solution(n: int = 10) -> int:
return sum(
int("".join(map(str, num)))
for num in permutations(range(n))
if is_substring_divisible(num)
) | project_euler |
def is_pentagonal(n: int) -> bool:
root = (1 + 24 * n) ** 0.5
return ((1 + root) / 6) % 1 == 0 | project_euler |
def solution(limit: int = 5000) -> int:
pentagonal_nums = [(i * (3 * i - 1)) // 2 for i in range(1, limit)]
for i, pentagonal_i in enumerate(pentagonal_nums):
for j in range(i, len(pentagonal_nums)):
pentagonal_j = pentagonal_nums[j]
a = pentagonal_i + pentagonal_j
b ... | project_euler |
def maxpooling(arr: np.ndarray, size: int, stride: int) -> np.ndarray:
arr = np.array(arr)
if arr.shape[0] != arr.shape[1]:
raise ValueError("The input array is not a square matrix")
i = 0
j = 0
mat_i = 0
mat_j = 0
# compute the shape of the output matrix
maxpool_shape = (arr.sh... | computer_vision |
def avgpooling(arr: np.ndarray, size: int, stride: int) -> np.ndarray:
arr = np.array(arr)
if arr.shape[0] != arr.shape[1]:
raise ValueError("The input array is not a square matrix")
i = 0
j = 0
mat_i = 0
mat_j = 0
# compute the shape of the output matrix
avgpool_shape = (arr.sh... | computer_vision |
def __init__(self, k: float, window_size: int):
if k in (0.04, 0.06):
self.k = k
self.window_size = window_size
else:
raise ValueError("invalid k value") | computer_vision |
def __str__(self) -> str:
return str(self.k) | computer_vision |
def detect(self, img_path: str) -> tuple[cv2.Mat, list[list[int]]]:
img = cv2.imread(img_path, 0)
h, w = img.shape
corner_list: list[list[int]] = []
color_img = img.copy()
color_img = cv2.cvtColor(color_img, cv2.COLOR_GRAY2RGB)
dy, dx = np.gradient(img)
ixx = dx*... | computer_vision |
def mean_threshold(image: Image) -> Image:
height, width = image.size
mean = 0
pixels = image.load()
for i in range(width):
for j in range(height):
pixel = pixels[j, i]
mean += pixel
mean //= width * height
for j in range(width):
for i in range(height):
... | computer_vision |
def main() -> None:
img_paths, annos = get_dataset(LABEL_DIR, IMAGE_DIR)
print("Processing...")
new_images, new_annos, paths = update_image_and_anno(img_paths, annos, FLIP_TYPE)
for index, image in enumerate(new_images):
# Get random string code: '7b7ad245cdff75241935e4dd860f3bad'
lette... | computer_vision |
def get_dataset(label_dir: str, img_dir: str) -> tuple[list, list]:
img_paths = []
labels = []
for label_file in glob.glob(os.path.join(label_dir, "*.txt")):
label_name = label_file.split(os.sep)[-1].rsplit(".", 1)[0]
with open(label_file) as in_file:
obj_lists = in_file.readline... | computer_vision |
def update_image_and_anno(
img_list: list, anno_list: list, flip_type: int = 1
) -> tuple[list, list, list]:
new_annos_lists = []
path_list = []
new_imgs_list = []
for idx in range(len(img_list)):
new_annos = []
path = img_list[idx]
path_list.append(path)
img_annos = ... | computer_vision |
def random_chars(number_char: int = 32) -> str:
assert number_char > 1, "The number of character should greater than 1"
letter_code = ascii_lowercase + digits
return "".join(random.choice(letter_code) for _ in range(number_char)) | computer_vision |
def warp(
image: np.ndarray, horizontal_flow: np.ndarray, vertical_flow: np.ndarray
) -> np.ndarray:
flow = np.stack((horizontal_flow, vertical_flow), 2)
# Create a grid of all pixel coordinates and subtract the flow to get the
# target pixels coordinates
grid = np.stack(
np.meshgrid(np.ara... | computer_vision |
def horn_schunck(
image0: np.ndarray,
image1: np.ndarray,
num_iter: SupportsIndex,
alpha: float | None = None,
) -> tuple[np.ndarray, np.ndarray]:
if alpha is None:
alpha = 0.1
# Initialize flow
horizontal_flow = np.zeros_like(image0)
vertical_flow = np.zeros_like(image0)
#... | computer_vision |
def price_plus_tax(price: float, tax_rate: float) -> float:
return price * (1 + tax_rate) | financial |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.