'Attempt to fetch a key out of the local cache.
If the key exists, but is beyond expiration, we only
return it if grace=True. This forces the key to be returned
in a disaster scenario as long as we\'re still holding onto it.
This allows the OptionStore to pave over potential network hiccups
by returning a stale value.'

def get_local_cache(self, key, force_grace=False):

    try:
        (value, expires, grace) = self._local_cache[key.cache_key]
    except KeyError:
        return None
    now = int(time())
    if (now < expires):
        return value
    if (force_grace and (now < grace)):
        return value
    if (now > grace):
        try:
            del self._local_cache[key.cache_key]
        except KeyError:
            pass
    return None
