(key)
| 40 | global_cache = json.load(f) |
| 41 | |
| 42 | def get_cache(key): |
| 43 | if key not in global_cache: |
| 44 | global_cache[key] = [] |
| 45 | |
| 46 | if key not in global_cache_index: |
| 47 | global_cache_index[key] = 0 |
| 48 | |
| 49 | current_items = global_cache[key] |
| 50 | current_index = global_cache_index[key] |
| 51 | if len(current_items) > current_index: |
| 52 | global_cache_index[key] += 1 |
| 53 | if key not in cache_queries: |
| 54 | cache_queries[key] = [] |
| 55 | cache_queries[key].append(current_items[current_index]) |
| 56 | return current_items[current_index] |
| 57 | |
| 58 | return None |
| 59 | |
| 60 | def add_cache(key, value): |
| 61 | global_cache_index[key] += 1 |
no outgoing calls
no test coverage detected