Added files
This commit is contained in:
13
python/decorators.py
Normal file
13
python/decorators.py
Normal 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)
|
Reference in New Issue
Block a user