Return if a key exists in the cache.
19773
def exists(self, key, **opts):
        """"""
        key, store = self._expand_opts(key, opts)
        data = store.get(key)
        # Note that we do not actually delete the thing here as the max_age
        # just for this call may have triggered a False.
        if not data or self._has_expired(data, opts):
            return False
        return True
707023
def contains(bank, key, cachedir):
    '''
    
    '''
    if key is None:
        base = os.path.join(cachedir, os.path.normpath(bank))
        return os.path.isdir(base)
    else:
        keyfile = os.path.join(cachedir, os.path.normpath(bank), '{0}.p'.format(key))
        return os.path.isfile(keyfile)
681341
public function isInCache($key)
  {
    $file = $this->cachePath . $this->getEncodedKey($key);
    return file_exists($file);
  }
1104109
def key?(key)
      # First, check if item is already cached in memory
      return true if @cache.key?(key)
      # Otherwise, it might be cached on disk
      # but we should not consider the disk cache if it is disabled
      return false unless disk_cache_enabled?

      path = path_to(hash(key))
      File.file?(path) && File.readable?(path)
    end
1108058
@SuppressWarnings("unchecked")
    public synchronized boolean containsKey(Object key) {
        return cache.containsKey(key) || (isDiskCacheEnabled && getFileForKey((KeyT) key).exists());
    }
917277
function existsInCache(x, cache) {
  var found = _.find(cache, function(y) {
    return appsAreEqual(x, y);
  });
  return !!found;
}
82566
def get(self, key):
        

        if not self.is_loaded:
            self.retrieve()

            self.is_loaded = True

        if self.has(key=key):
            return self.data[key]
        else:
            return None
270690
def contains(self, key):
    '''
    '''
    path = self.object_path(key)
    return os.path.exists(path) and os.path.isfile(path)
781388
function has(key) {
    if (options.cacheValues) {
      return Promise.resolve((cachedData[key] !== undefined));
    } else if (options.cacheKeys) {
      return Promise.resolve((cachedKeys.indexOf(key) !== -1));
    } else {
      return readData().then(function(data) {
        return (data[key] !== undefined);
      });
    }
  }
170730
public static function has( $key )
	{
		$cache = self::instance();
		if ( $cache ) {
			return $cache->isExisting( $key );
		}
		return false;
	}
1047137
def _lookup(key):
    
    if key not in _CACHE:
        return None
    if _CACHE_COUNTER[key] >= len(_CACHE[key][1:]):
        if _CACHE[key][0] == "empty":
            return ""
        elif _CACHE[key][0] == "repeat" and _CACHE[key][1:]:
            return _CACHE[key][-1]
        elif _CACHE[key][0] == "repeat":
            return ""
        else:
            _CACHE_COUNTER[key] = 1
    else:
        _CACHE_COUNTER[key] += 1
    if _CACHE[key]:
        return _CACHE[key][_CACHE_COUNTER[key]]
    else:
        return ""
718642
def contains(self, key):
    '''
    '''
    return self.cache_datastore.contains(key) \
        or self.child_datastore.contains(key)
365779
def _get_cache_key(self, obj):
        """"""
        if obj is not None:
            # Make sure that key is REALLY unique.
            return '{}-{}'.format(id(self), obj.pk)

        return "{}-None".format(id(self))
225492
def has_key(self, key):
        
        if key in self._dict:
            try: 
                self[key]
                return True
            except ValueError:
                return False
            except KeyError:
                return False
        return False
597948
public static function has(string $key) : bool
  {
    if ((new Cache)->retrieve($key) == null) return false;
    return true;
  }
605409
def has(self):
        """"""
        self._done = os.path.exists(self._cache_file)
        return self._done or self._out is not None
207485
def exists(self):
        
        try:
            key = self.key
        except DoesNotExist:
            """
            If the object doesn't exists anymore, its PK is deleted, so the
            "self.key" call will raise a DoesNotExist exception. We catch it
            to return False, as the field doesn't exists too.
            """
            return False
        else:
            return self.connection.exists(key)