Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ venv
__pycache__
.pytest_cache
.ruff_check
.vscode
all_conditions/

# Python Files
*solved.ipynb
Binary file added Mitral disease stages.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion homeworks/sem01/hw1/aggregate_segmentation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ALLOWED_TYPES = {
'''ALLOWED_TYPES = {
"spotter_word",
"voice_human",
"voice_bot",
Expand Down Expand Up @@ -26,3 +26,4 @@ def aggregate_segmentation(

# ваш код
return {}, []
'''
3 changes: 2 additions & 1 deletion homeworks/sem01/hw1/backoff.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from random import uniform
'''from random import uniform
from time import sleep
from typing import (
Callable,
Expand Down Expand Up @@ -36,3 +36,4 @@ def backoff(

# ваш код
pass
'''
3 changes: 2 additions & 1 deletion homeworks/sem01/hw1/cache.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import (
'''from typing import (
Callable,
ParamSpec,
TypeVar,
Expand All @@ -25,3 +25,4 @@ def lru_cache(capacity: int) -> Callable[[Callable[P, R]], Callable[P, R]]:
"""
# ваш код
pass
'''
3 changes: 2 additions & 1 deletion homeworks/sem01/hw1/convert_exception.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import (
'''from typing import (
Callable,
ParamSpec,
TypeVar,
Expand Down Expand Up @@ -26,3 +26,4 @@ def convert_exceptions_to_api_compitable_ones(

# ваш код
pass
'''
Binary file added labyrinth.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added loaded_labyrinth.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added modulated_signal.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions requirements-ci.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
ipython==9.10.1
matplotlib==3.8.0
numpy==1.26.1
pandas==2.2.2
pillow==11.1.0

pytest==8.4.2
pytest-cov==7.0.0
Expand Down
3 changes: 2 additions & 1 deletion solutions/sem01/lesson02/task1.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
def get_factorial(num: int) -> int:
'''def get_factorial(num: int) -> int:
factorial = 1
# ваш код
return factorial
'''
3 changes: 2 additions & 1 deletion solutions/sem01/lesson02/task2.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
def get_doubled_factorial(num: int) -> int:
'''def get_doubled_factorial(num: int) -> int:
factorial = 1
# ваш код
return factorial
'''
3 changes: 2 additions & 1 deletion solutions/sem01/lesson02/task3.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
def get_amount_of_ways_to_climb(stair_amount: int) -> int:
'''def get_amount_of_ways_to_climb(stair_amount: int) -> int:
step_prev, step_curr = 1, 1
# ваш код
return step_curr
'''
3 changes: 2 additions & 1 deletion solutions/sem01/lesson02/task4.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
def get_multiplications_amount(num: int) -> int:
'''def get_multiplications_amount(num: int) -> int:
multiplications_amount = 0
# ваш код
return multiplications_amount
'''
3 changes: 2 additions & 1 deletion solutions/sem01/lesson02/task5.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
def get_gcd(num1: int, num2: int) -> int:
'''def get_gcd(num1: int, num2: int) -> int:
# ваш код
return num1
'''
3 changes: 2 additions & 1 deletion solutions/sem01/lesson02/task6.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
def get_sum_of_prime_divisors(num: int) -> int:
'''def get_sum_of_prime_divisors(num: int) -> int:
sum_of_divisors = 0
# ваш код
return sum_of_divisors
'''
3 changes: 2 additions & 1 deletion solutions/sem01/lesson02/task7.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
def is_palindrome(num: int) -> bool:
'''def is_palindrome(num: int) -> bool:
num_reversed = 0
num_origin = num
# ваш код
return num_origin == num_reversed
'''
5 changes: 3 additions & 2 deletions solutions/sem01/lesson03/task1.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
def flip_bits_in_range(num: int, left_bit: int, right_bit: int) -> int:
'''def flip_bits_in_range(num: int, left_bit: int, right_bit: int) -> int:
# ваш код
return num
return num
'''
5 changes: 3 additions & 2 deletions solutions/sem01/lesson03/task2.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
def get_cube_root(n: float, eps: float) -> float:
'''def get_cube_root(n: float, eps: float) -> float:
# ваш код
return n
return n
'''
3 changes: 2 additions & 1 deletion solutions/sem01/lesson03/task3.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
def get_nth_digit(num: int) -> int:
'''def get_nth_digit(num: int) -> int:
# ваш код
return 0
'''
5 changes: 3 additions & 2 deletions solutions/sem01/lesson04/task1.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
def is_arithmetic_progression(lst: list[list[int]]) -> bool:
'''def is_arithmetic_progression(lst: list[list[int]]) -> bool:
# ваш код
return False
return False
'''
5 changes: 3 additions & 2 deletions solutions/sem01/lesson04/task2.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
def merge_intervals(intervals: list[list[int, int]]) -> list[list[int, int]]:
'''def merge_intervals(intervals: list[list[int, int]]) -> list[list[int, int]]:
# ваш код
return [[0,0]]
return [[0,0]]
'''
3 changes: 2 additions & 1 deletion solutions/sem01/lesson04/task3.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
def find_single_number(nums: list[int]) -> int:
'''def find_single_number(nums: list[int]) -> int:
# ваш код
return 0
'''
5 changes: 3 additions & 2 deletions solutions/sem01/lesson04/task4.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
def move_zeros_to_end(nums: list[int]) -> list[int]:
'''def move_zeros_to_end(nums: list[int]) -> list[int]:
# ваш код
return 0
return 0
'''
5 changes: 3 additions & 2 deletions solutions/sem01/lesson04/task5.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
def find_row_with_most_ones(matrix: list[list[int]]) -> int:
'''def find_row_with_most_ones(matrix: list[list[int]]) -> int:
# ваш код
return 0
return 0
'''
5 changes: 3 additions & 2 deletions solutions/sem01/lesson04/task6.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
def count_cycles(arr: list[int]) -> int:
'''def count_cycles(arr: list[int]) -> int:
# ваш код
return 0
return 0
'''
5 changes: 3 additions & 2 deletions solutions/sem01/lesson05/task1.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
def is_palindrome(text: str) -> bool:
'''def is_palindrome(text: str) -> bool:
# ваш код
return False
return False
'''
5 changes: 3 additions & 2 deletions solutions/sem01/lesson05/task2.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
def are_anagrams(word1: str, word2: str) -> bool:
'''def are_anagrams(word1: str, word2: str) -> bool:
# ваш код
return False
return False
'''
3 changes: 2 additions & 1 deletion solutions/sem01/lesson05/task3.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
def is_punctuation(text: str) -> bool:
'''def is_punctuation(text: str) -> bool:
# ваш код
return False
'''
5 changes: 3 additions & 2 deletions solutions/sem01/lesson05/task4.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
def unzip(compress_text: str) -> str:
'''def unzip(compress_text: str) -> str:
# ваш код
return compress_text
return compress_text
'''
5 changes: 3 additions & 2 deletions solutions/sem01/lesson05/task5.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
def reg_validator(reg_expr: str, text: str) -> bool:
'''def reg_validator(reg_expr: str, text: str) -> bool:
# ваш код
return False
return False
'''
5 changes: 3 additions & 2 deletions solutions/sem01/lesson05/task6.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
def simplify_path(path: str) -> str:
'''def simplify_path(path: str) -> str:
# ваш код
return path
return path
'''
5 changes: 3 additions & 2 deletions solutions/sem01/lesson06/task1.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
def int_to_roman(num: int) -> str:
'''def int_to_roman(num: int) -> str:
# ваш код
return ""
return ""
'''
5 changes: 3 additions & 2 deletions solutions/sem01/lesson06/task2.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
def get_len_of_longest_substring(text: str) -> int:
'''def get_len_of_longest_substring(text: str) -> int:
# ваш код
return 0
return 0
'''
3 changes: 2 additions & 1 deletion solutions/sem01/lesson06/task3.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
def is_there_any_good_subarray(
'''def is_there_any_good_subarray(
nums: list[int],
k: int,
) -> bool:

# ваш код
return False
'''
5 changes: 3 additions & 2 deletions solutions/sem01/lesson06/task4.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
def count_unique_words(text: str) -> int:
'''def count_unique_words(text: str) -> int:
# ваш код
return 0
return 0
'''
5 changes: 3 additions & 2 deletions solutions/sem01/lesson08/task1.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from typing import Callable
'''from typing import Callable

def make_averager(accumulation_period: int) -> Callable[[float], float]:
# ваш код
pass
pass
'''
5 changes: 3 additions & 2 deletions solutions/sem01/lesson08/task2.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Callable, TypeVar
'''from typing import Callable, TypeVar

T = TypeVar("T")

Expand All @@ -7,4 +7,5 @@ def collect_statistic(
) -> Callable[[T], T]:

# ваш код
pass
pass
'''
3 changes: 2 additions & 1 deletion solutions/sem01/lesson11/task1.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class Vector2D:
'''class Vector2D:
def conj(self) -> "Vector2D":
# ваш код
return Vector2D()
Expand All @@ -8,3 +8,4 @@ def get_angle(self, other: "Vector2D") -> float:
return 0

# ваш код
'''
3 changes: 2 additions & 1 deletion solutions/sem01/lesson12/task1.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from typing import Any, Generator, Iterable
'''from typing import Any, Generator, Iterable


def chunked(iterable: Iterable, size: int) -> Generator[tuple[Any], None, None]:
# ваш код
...
'''
3 changes: 2 additions & 1 deletion solutions/sem01/lesson12/task2.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from typing import Any, Generator, Iterable
'''from typing import Any, Generator, Iterable


def circle(iterable: Iterable) -> Generator[Any, None, None]:
# ваш код
...
'''
3 changes: 2 additions & 1 deletion solutions/sem01/lesson12/task3.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import sys
'''#import sys


class FileOut:
Expand All @@ -10,3 +10,4 @@ def __init__(
...

# ваш код
'''
16 changes: 13 additions & 3 deletions solutions/sem02/lesson03/task1.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,23 @@ class ShapeMismatchError(Exception):
def sum_arrays_vectorized(
lhs: np.ndarray,
rhs: np.ndarray,
) -> np.ndarray: ...
) -> np.ndarray:
if lhs.shape != rhs.shape:
raise ShapeMismatchError
return lhs + rhs


def compute_poly_vectorized(abscissa: np.ndarray) -> np.ndarray: ...
def compute_poly_vectorized(abscissa: np.ndarray) -> np.ndarray:
return 3 * (abscissa**2) + 2 * abscissa + 1


def get_mutual_l2_distances_vectorized(
lhs: np.ndarray,
rhs: np.ndarray,
) -> np.ndarray: ...
) -> np.ndarray:
if lhs.shape[1] != rhs.shape[1]:
raise ShapeMismatchError
differences = lhs[:, np.newaxis] - rhs
distances = np.sqrt(np.sum(differences**2, axis=2))

return distances
Loading
Loading