code: def get_fs(
      path: path_type, storage_options: Dict = None
  ) -> FileSystem:
      if storage_options is None:
          storage_options = dict()
  
      # detect scheme
      if os.path.exists(path) or glob_.glob(path):
          scheme = "file"
      else:
          scheme = urlparse(path).scheme
      if scheme == "" or len(scheme) == 1:  # len == 1 for windows
          scheme = "file"
  
      if scheme in _filesystems:
          file_system_type = _filesystems[scheme]
          if scheme == "file" or scheme == "oss":
              # local file systems are singletons.
              return file_system_type.get_instance()
          else:
              storage_options = file_system_type.get_storage_options(
                  storage_options, path
              )
              return file_system_type(**storage_options)
      elif scheme in _scheme_to_dependencies:  # pragma: no cover
          dependencies = ", ".join(_scheme_to_dependencies[scheme])
          raise ImportError(
              f"Need to install {dependencies} to access {scheme}."
          )
      else:
          raise ValueError(
              f"Unknown file system type: {scheme}, "
              f'available include: {", ".join(_scheme_to_dependencies.keys())}'
          )
  
file_path: mars/mars/lib/filesystem/core.py
imports: import glob
  import os
  from typing import Dict, List
  from urllib.parse import urlparse
  from ..compression import compress
  from .base import path_type, FileSystem
  from .local import LocalFileSystem
  from .oss import OSSFileSystem
label_desc: Use image node_id 2 for calling a global function with example usage: get_fs(path, storage_options) and returns: file_system_type, file_system_type