(*args: T)
| 294 | ] = {} |
| 295 | |
| 296 | def cache_decorator_wrapper(*args: T) -> U: |
| 297 | if func not in decorator_function_to_instance_map: |
| 298 | decorator_function_to_instance_map[func] = LFUCache(size) |
| 299 | |
| 300 | result = decorator_function_to_instance_map[func].get(args[0]) |
| 301 | if result is None: |
| 302 | result = func(*args) |
| 303 | decorator_function_to_instance_map[func].put(args[0], result) |
| 304 | return result |
| 305 | |
| 306 | def cache_info() -> LFUCache[T, U]: |
| 307 | return decorator_function_to_instance_map[func] |