Returns true if object is cached.

        Args:
          objpath: Filename relative to buildroot.
          metahash: hash object
11001
def in_cache(self, objpath, metahash):
        
        try:
            self.path_in_cache(objpath, metahash)
            return True
        except CacheMiss:
            return False
392669
def object!(path)
      object = find_object path
      raise FileNotFoundError.new(path) if object.nil?
      object
    end
303971
function exists(filepath) {
  const cached = existsCache.has(filepath);

  // Only return positive to allow for generated files
  if (cached) return true;

  const filepathExists = fs.existsSync(filepath);

  if (filepathExists) existsCache.add(filepath);

  return filepathExists;
}
466997
function getFilePathWithHash(filePath, rel) {
  const indexOfLastDot = filePath.lastIndexOf('.');

  let filePathWithHash = filePath.substr(0, indexOfLastDot) +
    '.' +
    hashFile.sync(skyPagesConfigUtil.spaPath('src', filePath)) +
    '.' +
    filePath.substr(indexOfLastDot + 1);

  if (!rel) {
    const srcPath = skyPagesConfigUtil.spaPath('src');
    filePathWithHash = filePathWithHash.substr(srcPath.length + 1);
  }

  return filePathWithHash;
}
605409
def has(self):
        """"""
        self._done = os.path.exists(self._cache_file)
        return self._done or self._out is not None
416111
def load(path, cache=None, precache=False):
    
    parser = Stylesheet(cache)
    return parser.load(path, precache=precache)
1237499
private function isCached(string $path)
	{
		$views = glob($this->cacheDirectory . $this->DS . '*'. str_replace($this->DS, '___', $path));

		if (count($views) > 0) {
			$this->canRecache($path, $views[0]);
			return file_get_contents($views[0]) == null ? ' ' : file_get_contents($views[0]);
		}
		else {
			$this->cache($path, uniqid());
		}

		$views = glob($this->cacheDirectory . $this->DS . '*'. str_replace($this->DS, '___', $path));
		if (count($views) > 0) {
			return file_get_contents($views[0]) == null ? ' ' : file_get_contents($views[0]);
		}
	}
971451
function getCacheFilePaths(props: {
  filePath: string,
  transformOptions: TransformOptions,
}): CacheFilePaths {
  const hasher = imurmurhash()
    .hash(props.filePath)
    .hash(jsonStableStringify(props.transformOptions) || '');
  const hash = toFixedHex(8, hasher.result());
  const prefix = hash.substr(0, 2);
  const fileName = `${hash.substr(2)}${path.basename(props.filePath)}`;
  const base = path.join(getCacheDirPath(), prefix, fileName);
  return {transformedCode: base, metadata: base + '.meta'};
}
1025985
def is_cache_valid(self):
        '''  '''

        if os.path.isfile(self.cache_path_cache):
            mod_time = os.path.getmtime(self.cache_path_cache)
            current_time = time()
            if (mod_time + self.cache_max_age) > current_time:
                if os.path.isfile(self.cache_path_index):
                    return True

        return False
1172688
def cache_path(archive, root_dir, build_id):
    
    root = root_dir or Path("~/.shiv").expanduser()
    name = Path(archive.filename).resolve().stem
    return root / f"{name}_{build_id}"
1786
def get_object_from_path(path):
    
    try:
        return sys.IMPORT_CACHE[path]
    except KeyError:
        _path = path.split('.')
        module_path = '.'.join(_path[:-1])
        class_name = _path[-1]
        module = importlib.import_module(module_path)
        sys.IMPORT_CACHE[path] = getattr(module, class_name)
        return sys.IMPORT_CACHE[path]
792918
def is_cached(self, path, saltenv='base', cachedir=None):
        '''
        
        '''
        if path.startswith('salt://'):
            path, senv = salt.utils.url.parse(path)
            if senv:
                saltenv = senv

        escaped = True if salt.utils.url.is_escaped(path) else False

        # also strip escape character '|'
        localsfilesdest = os.path.join(
            self.opts['cachedir'], 'localfiles', path.lstrip('|/'))
        filesdest = os.path.join(
            self.opts['cachedir'], 'files', saltenv, path.lstrip('|/'))
        extrndest = self._extrn_path(path, saltenv, cachedir=cachedir)

        if os.path.exists(filesdest):
            return salt.utils.url.escape(filesdest) if escaped else filesdest
        elif os.path.exists(localsfilesdest):
            return salt.utils.url.escape(localsfilesdest) \
                if escaped \
                else localsfilesdest
        elif os.path.exists(extrndest):
            return extrndest

        return ''
665892
def jpath_exists(structure, jpath):
    
    result = jpath_value(structure, jpath)
    if not result is None:
        return True
    return False
543131
def cache(self, obj):
        '''
        
        '''
        # Check cache path exists for current obj
        write_path = os.path.join( self.cache_path, obj.org_id )
        if not os.path.exists( write_path ): 
            mkdir_p( write_path )

        with open(os.path.join( write_path, obj.id ), 'wb') as f:
            pickle.dump( obj, f )
        
        # Add to localstore (keep track of numbers of objects, etc.)
        self.add_to_localstore(obj)   
        self.add_to_names(obj)
35594
def is_path(path):
    
    if not isinstance(path, basestring):
        return False
    portal_path = get_path(get_portal())
    if not path.startswith(portal_path):
        return False
    obj = get_object_by_path(path)
    if obj is None:
        return False
    return True
1358853
def check_cache(self, type, data, obj=None):
        ''''''
        try:
            id = data['id']
        except:
            # Not an identifiable item
            #print 'don\'t know this item %r:%r' % (type, data)
            return data

        # If obj was passed in, its type takes precedence
        try:
            type = obj._get_type()
        except:
            pass

        # Find the item in the cache, update and return if it's there
        try:
            hit = self.item_cache[type][id]
        except KeyError:
            pass
        else:
            hit._update_data(data)
            #print 'cache hit for %s at %s' % (type, id)
            return hit

        # Not there? Let's make us a new item
        # If we weren't given the object ref, find the name in the global scope
        if not obj:
            # Default to Redmine_Item if it's not found
            obj = self.item_class.get(type, Redmine_Item)

        new_item = obj(redmine=self, data=data, type=type)

        # Store it
        self.item_cache.setdefault(type, {})[id] = new_item
        #print 'set new %s at %s' % (type, id)

        return new_item
23129
def isInCache(self):
    
    url = self.buildUrl(cache_friendly=True)
    return url in __class__.cache