(*args)
| 141 | |
| 142 | @functools.wraps(func) |
| 143 | def wrapper(*args): |
| 144 | # Disabling caching in test mode |
| 145 | if config.is_test_mode(): |
| 146 | return func(*args) |
| 147 | |
| 148 | try: |
| 149 | return memory[args] |
| 150 | except KeyError: |
| 151 | memory[args] = func(*args) |
| 152 | return memory[args] |
| 153 | |
| 154 | return wrapper |
| 155 |