Use key or identity generate from key and param to
        get cached content and expire time.
        Compare expire time with time.now(), return None and
        set cache with extended timeout if cache is expired,
        else, return unpacked content
487022
async def get(self, key, param=None, extend_herd_timeout=None):
        
        identity = self._gen_identity(key, param)
        res = await self.client.get(identity)
        if res:
            res, timeout = self._unpack(res)
            now = int(time.time())
            if timeout <= now:
                extend_timeout = extend_herd_timeout or self.extend_herd_timeout
                expected_expired_ts = now + extend_timeout
                value = self._pack([res, expected_expired_ts])
                await self.client.set(identity, value, extend_timeout)
                return None
        return res
228210
function get (key) {
  return isExpired(key).then(hasExpired => {
    if (hasExpired) {
      return remove(key).then(() => Promise.resolve(undefined))
    } else {
      return storage.get(`${prefix}${key}`)
    }
  })
}
375697
def load(self, key, noexpire=None):
        ''''''
        with self.load_fd(key, noexpire=noexpire) as fd:
            return fd.read()
502604
def _get_payload(self, key):
        
        path = self._path(key)

        # If the file doesn't exists, we obviously can't return the cache so we will
        # just return null. Otherwise, we'll get the contents of the file and get
        # the expiration UNIX timestamps from the start of the file's contents.
        if not os.path.exists(path):
            return {'data': None, 'time': None}

        with open(path, 'rb') as fh:
            contents = fh.read()

        expire = int(contents[:10])

        # If the current time is greater than expiration timestamps we will delete
        # the file and return null. This helps clean up the old files and keeps
        # this directory much cleaner for us as old files aren't hanging out.
        if round(time.time()) >= expire:
            self.forget(key)

            return {'data': None, 'time': None}

        data = self.unserialize(contents[10:])

        # Next, we'll extract the number of minutes that are remaining for a cache
        # so that we can properly retain the time for things like the increment
        # operation that may be performed on the cache. We'll round this out.
        time_ = math.ceil((expire - round(time.time())) / 60.)

        return {'data': data, 'time': time_}
1283161
def get_cache_key(content, **kwargs):
    ''''''
    cache_key = ''
    for key in sorted(kwargs.keys()):
        cache_key = '{cache_key}.{key}:{value}'.format(
            cache_key=cache_key,
            key=key,
            value=kwargs[key],
        )

    cache_key = '{content}{cache_key}'.format(
        content=content,
        cache_key=cache_key,
    )

    # fix for non ascii symbols, ensure encoding, python3 hashlib fix
    cache_key = cache_key.encode('utf-8', 'ignore')
    cache_key = md5(cache_key).hexdigest()

    cache_key = '{prefix}.{version}.{language}.{cache_key}'.format(
        prefix=settings.ACTIVE_URL_CACHE_PREFIX,
        version=__version__,
        language=get_language(),
        cache_key=cache_key
    )

    return cache_key
1263471
def cache(self, name='cache', default_timeout=3600):
        
        return Cache(self, name=name, default_timeout=default_timeout)
1308028
def expires_at(self):
        """"""
        try:
            expires = min(sig.key_expiration for sig in itertools.chain(iter(uid.selfsig for uid in self.userids), self.self_signatures)
                          if sig.key_expiration is not None)

        except ValueError:
            return None

        else:
            return (self.created + expires)
170851
def get(self, key):
        
        data = self._store.get(key)
        if not data:
            return None
        value, expire = data
        if expire and time.time() > expire:
            del self._store[key]
            return None
        return value
1218236
function flushExpired () {
  return storage.keys().then(keys => {
    const cacheKeys = keys.filter(key => key.indexOf(expire) === 0)
    return Promise.all(cacheKeys.map(key => get(key.slice(prefix.length))))
  })
}
367935
def unwrap(self, dt):
        
        expires = self._expires
        if expires is AlwaysExpired or expires < dt:
            raise Expired(self._expires)
        return self._value
1255273
def get_value(self, merge=True, createfunc=None,
                  expiration_time=None, ignore_expiration=False):
        
        cache, cache_key = self._get_cache_plus_key()

        # ignore_expiration means, if the value is in the cache
        # but is expired, return it anyway.   This doesn't make sense
        # with createfunc, which says, if the value is expired, generate
        # a new value.
        assert not ignore_expiration or not createfunc, \
            "Can't ignore expiration and also provide createfunc"

        if ignore_expiration or not createfunc:
            cached_value = cache.get(cache_key,
                                     expiration_time=expiration_time,
                                     ignore_expiration=ignore_expiration)
        else:
            cached_value = cache.get(cache_key)
            if not cached_value:
                cached_value = createfunc()
                cache.set(cache_key, cached_value, timeout=expiration_time)

        if cached_value and merge:
            cached_value = self.merge_result(cached_value, load=False)

        return cached_value
190990
def get_from_cache(key):
        

        try:
            value = cache.get(key)
            return json.loads(value), key if value else None
        except Exception as e:
            # todo should add log.error()
            return None
211283
def get(self, key, default=CACHE_MISS):
        
        if not self.options.enabled:
            return CACHE_DISABLED
        ret = default
        if self.has(key):
            ret = self._dict[key].value
        logger.debug('get({}, default={}) == {}'.format(repr(key), repr(default), repr(ret)))
        return ret
1047856
def touch(self, key, owner, expire=None):
        
        lock = self.collection.find_one({'_id': key, 'owner': owner})
        if not lock:
            raise MongoLockException(u'Can\'t find lock for {key}: {owner}'.format(key=key, owner=owner))
        if not lock['expire']:
            return
        if not expire:
            raise MongoLockException(u'Can\'t touch lock without expire for {0}: {1}'.format(key, owner))
        expire = datetime.utcnow() + timedelta(seconds=expire)
        self.collection.update(
            {'_id': key, 'owner': owner},
            {'$set': {'expire': expire}}
        )
1182571
def get(self, key, default=Empty, creator=Empty, expire=None):
        
        try:
            return self.storage.get(key)
        except KeyError as e:
            if creator is not Empty:
                if callable(creator):
                    v = creator()
                else:
                    v = creator
                self.set(key, v, expire)
                return v
            else:
                if default is not Empty:
                    if callable(default):
                        v = default()
                        return v
                    return default
                else:
                    raise
914861
def get(self, key):
        

        if not key in self._actions:
            return None
        if not key in self._cache:
            self._cache[key] = self._actions[key]()

        return self._cache[key]
599354
function(key) {

            // get value and time left
            var ret = {
                value: this._storage.getItem(key),
                timeLeft: this.getTimeLeft(key),
            };

            // set if expired
            ret.isExpired = ret.timeLeft !== null && ret.timeLeft <= 0;

            // return data
            return ret;
        }