Initial commit

This commit is contained in:
mrsobakin 2023-09-08 14:40:37 +03:00
commit ee3c2358ff
12 changed files with 622 additions and 0 deletions

14
lyrics_dl/utils.py Normal file
View file

@ -0,0 +1,14 @@
from typing import Iterator, Optional, TypeVar
def threshold_equal(a: float, b: float, epsilon: float) -> bool:
return abs(a - b) <= epsilon
T = TypeVar('T')
def next_or_none(iterator: Iterator[T]) -> Optional[T]:
try:
return next(iterator)
except StopIteration:
return None