Return the registered filesystem for the given file.
334068
def get_filesystem(filename):
    """"""
    filename = compat.as_str_any(filename)
    prefix = ""
    index = filename.find("://")
    if index >= 0:
        prefix = filename[:index]
    fs = _REGISTERED_FILESYSTEMS.get(prefix, None)
    if fs is None:
        raise ValueError("No recognized filesystem for prefix %s" % prefix)
    return fs
816123
def _initFilesystemInfo(self):
        """"""
        self._mapFSpathDev = {}
        fsinfo = FilesystemInfo()
        for fs in fsinfo.getFSlist():
            devpath = fsinfo.getFSdev(fs)
            dev = self._getUniqueDev(devpath)
            if dev is not None:
                self._mapFSpathDev[fs] = dev
296857
def get_file(self, file_path, mode="r"):
        
        return open(self.p(file_path), mode=mode)
912562
public static FileSystem getOptionallyThrottledFileSystem(FileSystem fs, State state) throws IOException {
    DeprecationUtils.renameDeprecatedKeys(state, MAX_FILESYSTEM_QPS, DEPRECATED_KEYS);

    if (state.contains(MAX_FILESYSTEM_QPS)) {
      return getOptionallyThrottledFileSystem(fs, state.getPropAsInt(MAX_FILESYSTEM_QPS));
    }
    return fs;
  }
637618
def _get_path(self, file):
        """"""
        dir = self._cache_directory()
        if not os.path.exists(dir):
            os.makedirs(dir)
        return os.path.join(dir, file)
162411
function(file) {
    var filePath = path.resolve(file);

    if (filePath && fs.existsSync(filePath)) {
      return filePath;
    }

    return false;
  }
103595
def glob(self):
        """"""

        # Cached symlinks
        self.symlinks = {}

        if self.is_bytes:
            curdir = os.fsencode(os.curdir)
        else:
            curdir = os.curdir

        for pattern in self.pattern:
            # If the pattern ends with `/` we return the files ending with `/`.
            dir_only = pattern[-1].dir_only if pattern else False

            if pattern:
                if not pattern[0].is_magic:
                    # Path starts with normal plain text
                    # Lets verify the case of the starting directory (if possible)
                    this = pattern[0]

                    curdir = this[0]

                    if not os.path.lexists(curdir):
                        return

                    # Make sure case matches, but running case insensitive
                    # on a case sensitive file system may return more than
                    # one starting location.
                    results = [curdir] if this.is_drive else self._get_starting_paths(curdir)
                    if not results:
                        if not dir_only:
                            # There is no directory with this name,
                            # but we have a file and no directory restriction
                            yield curdir
                        return

                    if this.dir_only:
                        # Glob these directories if they exists
                        for start in results:
                            if os.path.isdir(start):
                                rest = pattern[1:]
                                if rest:
                                    this = rest.pop(0)
                                    for match in self._glob(curdir, this, rest):
                                        if not self._is_excluded(match, dir_only):
                                            yield os.path.join(match, self.empty) if dir_only else match
                                elif not self._is_excluded(curdir, dir_only):
                                    yield os.path.join(curdir, self.empty) if dir_only else curdir
                    else:
                        # Return the file(s) and finish.
                        for start in results:
                            if os.path.lexists(start) and not self._is_excluded(start, dir_only):
                                yield os.path.join(start, self.empty) if dir_only else start
                else:
                    # Path starts with a magic pattern, let's get globbing
                    rest = pattern[:]
                    this = rest.pop(0)
                    for match in self._glob(curdir if not curdir == self.current else self.empty, this, rest):
                        if not self._is_excluded(match, dir_only):
                            yield os.path.join(match, self.empty) if dir_only else match
1127127
def _get_filesystem_config(file_types):
    
    out = "     filesystems {\n"
    for file_type in sorted(list(file_types)):
        if file_type in _FILESYSTEM_CONFIG:
            out += _FILESYSTEM_CONFIG[file_type]
    out += "      }\n"
    return out
310600
private FileSystem getSrcFileSystem(Path src, boolean verifyChecksum
      ) throws IOException { 
    FileSystem srcFs = src.getFileSystem(getConf());
    srcFs.setVerifyChecksum(verifyChecksum);
    return srcFs;
  }
766413
def filepath(self) -> str:
        """"""
        return os.path.join(self._dirpath, self.name + '.nc')
144869
def get_file(fs, filename):
    ''''''
    storage = by_name(fs)
    if storage is None:
        abort(404)
    return storage.serve(filename)
19644
def get_file(db_folder, file_name):
    """"""
    if not os.path.isdir(db_folder):
        return
    file_name = file_name.lower().strip()
    for cand_name in os.listdir(db_folder):
        if cand_name.lower().strip() == file_name:
            return os.path.join(db_folder, cand_name)
1045710
def filedet(name, fobj=None, suffix=None):
    
    name = name or (fobj and fobj.name) or suffix
    separated = name.split('.')
    if len(separated) == 1:
        raise FiledetException('file name error.')

    key = '.' + separated[-1]
    return _file_type_map.get(key)
395594
def _find_file(f):
        """"""
        if os.path.isabs(f):
            return f
        else:
            for d in Config._dirs:
                _f = os.path.join(d, f)
                if os.path.isfile(_f):
                    return _f
            raise FiggypyError(
                "could not find configuration file {} in dirs {}"
                .format(f, Config._dirs)
            )
38902
def rfile(self):
        """"""
        self.__class__ = File
        self._morph()
        self.clear()
        return File.rfile(self)
352215
def stat(self, filename):
        """"""
        # NOTE: Size of the file is given by .st_size as returned from
        # os.stat(), but we convert to .length
        try:
            len = os.stat(compat.as_bytes(filename)).st_size
        except OSError:
            raise errors.NotFoundError(None, None, "Could not find file")
        return StatData(len)
177792
def ExistingFileOrNone(fname):
    """"""
    if os.path.isfile(fname):
        return fname
    elif fname.lower() == 'none':
        return None
    else:
        raise ValueError("%s must specify a valid file name or 'None'" % fname)