Назад к задачам
Условие задачи

Create a decorator that limits how often a given callable can be invoked. The time window (in seconds) is passed to the decorator as an argument. If the wrapped function is called again before the specified interval has passed, the decorator must raise a CalledTooOftenError. The decorator should be generic, work with any callable, and preserve the original function's signature.

def sample_func():
    print('foo')