code: def get_file_mode(fname: str) -> int:
      """Retrieves the file mode corresponding to fname in a filesystem-tolerant manner.
  
      Parameters
      ----------
  
      fname : unicode
          The path to the file to get mode from
  
      """
      # Some filesystems (e.g., CIFS) auto-enable the execute bit on files.  As a result, we
      # should tolerate the execute bit on the file's owner when validating permissions - thus
      # the missing least significant bit on the third octal digit. In addition, we also tolerate
      # the sticky bit being set, so the lsb from the fourth octal digit is also removed.
      return stat.S_IMODE(Path(fname).stat().st_mode) & 0o6677
  
imports: from __future__ import annotations
  import errno
  import os
  import site
  import stat
  import sys
  import tempfile
  import warnings
  from contextlib import contextmanager
  from pathlib import Path
  from typing import Any, Iterator, Optional
  import platformdirs
  from .utils import deprecation
label_desc: Use image node_id 18 for calling a global function with example usage: get_file_mode(fname) and returns: unknown