Implement a decorator factory called ttl cache that wraps a function with a memoizing callable combining LRU…
Implement a decorator factory called ttl cache that wraps a function with a memoizing callable combining LRU…: a task in repo2rlenv-r2e (Harbor dataset). The decorator must support three calling conventions: 1. @ttl cache(maxsize=128, ttl=600, timer=time.monotonic, typed=False) — called with…
The task
The decorator must support three calling conventions: 1. `@ttl_cache(maxsize=128, ttl=600, timer=time.monotonic, typed=False)` — called with explicit keyword or positional arguments. 2. `@ttl_cache()` — called with no arguments, using all defaults. 3. `ttl_cache(fn)` — called directly with a callable as the first…
Part of FineEnvs/repo2rlenv-r2e.