Path that should be used for caching. Different for all subclasses.
480315
def directory(cls, prefix=None):
        
        prefix = prefix or utility.read_config().directory
        name = cls.__name__.lower()
        directory = os.path.expanduser(os.path.join(prefix, name))
        utility.ensure_directory(directory)
        return directory
1190358
def joinpath(self, *args):
        
        return self.__class__(os.path.join(self, *args))
1047735
private URL getRelativePath(FacesContext facesContext, String path) throws IOException
    {
        URL url = (URL) _relativePaths.get(path);
        if (url == null)
        {
            url = _factory.resolveURL(facesContext, _src, path);
            if (url != null)
            {
                ViewResource viewResource = (ViewResource) facesContext.getAttributes().get(
                    FaceletFactory.LAST_RESOURCE_RESOLVED);
                if (viewResource != null)
                {
                    // If a view resource has been used to resolve a resource, the cache is in
                    // the ResourceHandler implementation. No need to cache in _relativeLocations.
                }
                else
                {
                    _relativePaths.put(path, url);
                }
            }
        }
        return url;
    }
1346814
def load(self, path: str) -> ClassFile:
        
        # Try to refresh the class from the cache, loading it from disk
        # if not found.
        try:
            r = self.class_cache.pop(path)
        except KeyError:
            with self.open(f'{path}.class') as source:
                r = self.klass(source)

        r.classloader = self
        # Even if it was found re-set the key to update the OrderedDict
        # ordering.
        self.class_cache[path] = r

        # If the cache is enabled remove every item over N started from
        # the least-used.
        if self.max_cache > 0:
            to_pop = max(len(self.class_cache) - self.max_cache, 0)
            for _ in repeat(None, to_pop):
                self.class_cache.popitem(last=False)

        return r
654747
def CacheFileObject(self, path_spec, file_object):
    
    self._file_object_cache.CacheObject(path_spec.comparable, file_object)
569439
def lookup_path_inherited(namespace, path, type)
      resolved = nil
      last_obj = namespace
      scopes = []
      last_sep = nil
      pos = 0

      if path =~ /\A(#{separators_match})/
        last_sep = $1
        path = $'
      end

      path.scan(/(.+?)(#{separators_match}|$)/).each do |part, sep|
        cur_obj = nil
        pos += "#{part}#{sep}".length
        parsed_end = pos == path.length

        if !last_obj || (!parsed_end && !last_obj.is_a?(CodeObjects::NamespaceObject))
          break # can't continue
        end

        collect_namespaces(last_obj).each do |ns|
          next if ns.is_a?(CodeObjects::Proxy)

          found = nil
          search_seps = []
          scopes.each do |scope|
            search_seps += separators_for_type(scope)
          end

          if search_seps.empty?
            search_seps =
              if ns.type == :root
                [""]
              elsif last_sep.nil?
                separators
              else
                [@default_sep]
              end
          end

          ([last_sep] | search_seps).compact.each do |search_sep|
            found = @registry.at(ns.path + search_sep.to_s + part)
            break if found
          end

          break cur_obj = found if found
        end

        last_sep = sep
        scopes = types_for_separator(sep) || []
        last_obj = cur_obj
        resolved = cur_obj if parsed_end && cur_obj && (type.nil? || type == cur_obj.type)
      end

      resolved
    end
874797
def _get_cached_path(
            self,
            field_name,
            path_or_url,
            download_if_missing=False,
            overwrite=False):
        
        if len(field_name) == 0:
            raise ValueError("Expected non-empty field name")
        if len(path_or_url) == 0:
            raise ValueError("Expected non-empty path_or_url")
        return self.download_cache.local_path_or_install_error(
            field_name=field_name,
            path_or_url=path_or_url,
            download_if_missing=download_if_missing,
            overwrite=overwrite)
883911
def tryload_cache(dpath, fname, cfgstr, verbose=None):
    
    try:
        return load_cache(dpath, fname, cfgstr, verbose=verbose)
    except IOError:
        return None
876046
def get_cache_path(profile_name):
    ''''''
    path = os.path.join(CACHE_DIR, profile_name, 'cache')
    if not os.path.exists(path):
        os.makedirs(path, exist_ok=True)
    return path
90308
def _cache_directory(self):
        
        if settings.unit_testing_mode or settings.use_test_cache:
            return os.path.join(settings.cache_directory.replace("Fortpy", "Fortpy_Testing"), self.py_tag)
        else:
            return os.path.join(settings.cache_directory, self.py_tag)
1046187
def get_cached(self, path, cache_name, **kwargs):
        
        if gw2api.cache_dir and gw2api.cache_time and cache_name:
            cache_file = os.path.join(gw2api.cache_dir, cache_name)
            if mtime(cache_file) >= time.time() - gw2api.cache_time:
                with open(cache_file, "r") as fp:
                    tmp = json.load(fp)
                return self.make_response(tmp["data"], tmp["meta"])
        else:
            cache_file = None

        meta, data = self._get(path, **kwargs)

        if cache_file:
            with open(cache_file, "w") as fp:
                json.dump({"meta": meta, "data": data}, fp, indent=2)

        return self.make_response(data, meta)
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}"
1004673
def cache_path_for_url(url):
    """"""
    m = hashlib.md5()
    m.update(url)
    digest = m.hexdigest()
    return os.path.join(CACHE_DIRECTORY, '%s.html' % digest)
190914
def local_cache_path(remote_url):
    """"""
    local_name = RESERVED_PATH_CHARS.sub("_", remote_url)
    return os.path.join(gettempdir(), local_name)
53634
def cache_file(self, local_path, ip, path):
        
        destination = self.__destination(ip, path)
        atomicish_move(local_path, destination)
1347093
def _cache_normalize_path(path):
    """"""
    # _module_file calls abspath on every path in sys.path every time it's
    # called; on a larger codebase this easily adds up to half a second just
    # assembling path components. This cache alleviates that.
    try:
        return _NORM_PATH_CACHE[path]
    except KeyError:
        if not path:  # don't cache result for ''
            return _normalize_path(path)
        result = _NORM_PATH_CACHE[path] = _normalize_path(path)
        return result
995871
function _path() {
    return this.__cache__._path = this.__cache__._path ||
      (this.superstate ? _path.call(this.superstate).concat(this) : [this]);
  }