Added files

This commit is contained in:
saundersp
2023-05-07 20:15:55 +02:00
parent c8e56c1277
commit e6194ac485
30 changed files with 4682 additions and 0 deletions

13
python/decorators.py Normal file
View File

@ -0,0 +1,13 @@
from typing import Callable, Iterable, Union, Any
from tqdm import tqdm
def njit(f: Union[Callable, str] = None, *args, **kwargs) -> Callable:
def decorator(func: Callable) -> Any:
return func
if callable(f):
return f
return decorator
def tqdm_iter(iter: Iterable, desc: str):
return tqdm(iter, leave = False, desc = desc)