What local filename will we use within the cache directory
        for the given URL/filename/decompress options.
542270
def local_filename(
            self,
            url=None,
            filename=None,
            decompress=False):
        
        return common.build_local_filename(url, filename, decompress)
380196
def file_url_to_local_path(file_url):
    
    parts = urlparse(file_url)
    path = unquote(parts.path)
    if path.startswith('/') and not path.startswith('//'):
        if ON_DARWIN:
            return path
        if len(parts.netloc) == 2 and parts.netloc[1] == ':':  # Drive letter and colon.
            return parts.netloc + path
        return 'C:' + path  # Assume C drive if it's just a path starting with /.
    if len(path) > 2 and path[1] == ':':
        return path
1104766
def _create_cache_filename(self, source_file):
        
        res = self._create_cache_key(source_file) + ".cache"
        return os.path.join(self.__dir, res)
43803
def _get_buckets_cache_filename(bucket, prefix):
    '''
    
    '''

    cache_dir = _get_cache_dir()
    if not os.path.exists(cache_dir):
        os.makedirs(cache_dir)

    return os.path.join(cache_dir, '{0}-{1}-files.cache'.format(bucket, prefix))
1069618
protected function cacheFileName( $placement = false )
    {
        $cacheFileName = $this->FileName . '-' . $this->RootDir . '-' . $this->DirectAccess;

        if ( !$this->DirectAccess )
        {
            $cacheFileName .= '-' . serialize( $this->overrideDirs() );
        }
        if ( $this->UseTextCodec )
        {
            $cacheFileName .= '-' . eZTextCodec::internalCharset();
        }
        if ( $placement )
        {
            $cacheFileName .= '-placement:' . $placement;
        }
        $filePreFix = explode( '.', $this->FileName);
        return $filePreFix[0] . '-' . md5( $cacheFileName ) . '.php';
    }
197308
def cache_path(self, name):
        
        return os.path.join(self._path, self.CACHE_DIR, name)
41817
def _get_filename_from_url(url):
    
    parse = urlparse(url)
    return os.path.basename(parse.path)
291815
def path_in_cache(self, filename, metahash):
        
        cpath = self._genpath(filename, metahash)
        if os.path.exists(cpath):
            return cpath
        else:
            raise CacheMiss
1096704
def _mk_cache_fn(vcf_fn, array_type, region=None, cachedir=None,
                 compress=False):
    """"""

    # ensure cache dir exists
    if cachedir is None:
        # use the VCF file name as the base for a directory name
        cachedir = vcf_fn + config.CACHEDIR_SUFFIX
    if not os.path.exists(cachedir):
        # ensure cache dir exists
        os.makedirs(cachedir)
    else:
        assert os.path.isdir(cachedir), \
            'unexpected error, cache directory is not a directory: %r' \
            % cachedir

    # handle compression
    if compress:
        suffix = 'npz'
    else:
        suffix = 'npy'

    # handle region
    if region is None:
        # loading the whole genome (i.e., all variants)
        cache_fn = os.path.join(cachedir, '%s.%s' % (array_type, suffix))
    else:
        # loading a specific region
        region = region.replace(':', '__').replace('-', '_')
        cache_fn = os.path.join(cachedir, '%s.%s.%s' % (array_type, region,
                                                        suffix))
    return cache_fn
292653
def cache_info(cache_dir, cache_key):
    
    filename = os.path.join(cache_dir, cache_key)
    return os.path.getmtime(filename) if os.path.exists(filename) else 0
448696
def _get_cache_filename(name, filename):
    """"""
    filename = os.path.abspath(filename)[1:]
    home_folder = os.path.expanduser('~')
    base_cache_dir = os.path.join(home_folder, '.git-lint', 'cache')

    return os.path.join(base_cache_dir, name, filename)
623182
function fromCache(options) {
  var filename = options.filename;
  if (options.cache) {
    if (filename) {
      if (cache[filename]) {
        return cache[filename];
      }
    }
    else {
      throw new Error('filename is required when using the cache option');
    }
  }
  return false;
}
28255
def cache_file(filename, reload_on_change=False, opts=default_opts):
    """"""
    filename = pyc2py(filename)
    if filename in file_cache:
        if reload_on_change: checkcache(filename)
        pass
    else:
        opts['use_linecache_lines'] = True
        update_cache(filename, opts)
        pass
    if filename in file_cache:
        return file_cache[filename].path
    else: return None
    return
1174817
def filename(self):
        """"""
        if os.path.splitext(self.destination)[1]:
            # If the filename has been given make use of it
            target_file = self.destination
        else:
            # Otherwise determine it from the url.
            parsed_url = urlparse(self.url)
            source_filename = (parsed_url.path.rpartition('/')[-1] or
                               parsed_url.hostname)
            target_file = os.path.join(self.destination, source_filename)

        return os.path.abspath(target_file)
472742
def file_uri(fname):
    """"""
    if os.name == 'nt':
        # Local file
        if re.search(r'^[a-zA-Z]:', fname):
            return 'file:///' + fname
        # UNC based path
        else:
            return 'file://' + fname
    else:
        return 'file://' + fname
942417
def filename_from_url(url, path=None):
    
    r = requests.get(url, stream=True)
    if 'Content-Disposition' in r.headers:
        filename = re.findall(r'filename=([^;]+)',
                              r.headers['Content-Disposition'])[0].strip('"\"')
    else:
        filename = os.path.basename(urllib.parse.urlparse(url).path)
    return filename
1216410
def _compute_filename(self, request: BaseRequest):
        ''''''
        path = self._path_namer.get_filename(request.url_info)

        if os.path.isdir(path):
            path += '.f'
        else:
            dir_name, name = os.path.split(path)
            path = os.path.join(anti_clobber_dir_path(dir_name), name)

        return path