code: def _get_fs_type(loc, path, _was_warned=[]):
      """Return file system info for given Paths. Provide pathlib path as input"""
      res = {"path": path}
      try:
          from psutil import disk_partitions
  
          parts = {Path(p.mountpoint): p for p in disk_partitions()}
          match = None
          for mp in parts:
              # if the mountpoint is the test path or its parent
              # take it, whenever there is no match, or a longer match
              if (mp == path or mp in path.parents) and (
                  match is None or len(mp.parents) > len(match.parents)
              ):
                  match = mp
          match = parts[match]
          for sattr, tattr in (
              ("fstype", "type"),
              ("maxpath", "max_pathlength"),
              ("opts", "mount_opts"),
          ):
              if hasattr(match, sattr):
                  res[tattr] = getattr(match, sattr)
      except Exception as exc:
          ce = CapturedException(exc)
          # if an exception occurs, leave out the fs type. The result renderer can
          # display a hint based on its lack in the report
          if not _was_warned:
              (
                  lgr.debug
                  if isinstance(exc, ImportError)
                  else lgr.warning
              )("Could not determine filesystem types due to %s", ce)
              # Rely on side-effect of [] as default arg
              _was_warned.append("warned")
      return res
  
imports: import logging
  import os
  import os.path
  import sys
  import tempfile
  import textwrap
  from collections import defaultdict
  from functools import partial
  from datalad.dochelpers import get_docstring_split
  from datalad.interface.base import Interface, build_doc
  from datalad.utils import ensure_unicode, getpwd, unlink, Path
  from datalad.support.external_versions import external_versions
  from datalad.support.exceptions import CapturedException, CommandError, InvalidGitRepositoryError
  from datalad import __version__
label_desc: Use image node_id 6 for calling a global function with example usage: _get_fs_type(loc, path, _was_warned) and returns: res