MCPcopy Index your code
hub / github.com/microsoft/qlib / get_cache

Method get_cache

qlib/data/cache.py:194–206  ·  view source on GitHub ↗

get mem cache :param mem_cache: MemCache attribute('c'/'i'/'f'). :param key: cache key. :return: cache value; if cache not exist, return None.

(mem_cache, key)

Source from the content-addressed store, hash-verified

192
193 @staticmethod
194 def get_cache(mem_cache, key):
195 """get mem cache
196
197 :param mem_cache: MemCache attribute('c'/'i'/'f').
198 :param key: cache key.
199 :return: cache value; if cache not exist, return None.
200 """
201 value = None
202 expire = False
203 if key in mem_cache:
204 value, latest_time = mem_cache[key]
205 expire = (time.time() - latest_time) > MemCacheExpire.CACHE_EXPIRE
206 return value, expire
207
208
209class CacheUtils:

Callers 2

datasetMethod · 0.80
calendarMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected