code: def is_file_hidden_posix(abs_path, stat_res=None):
      """Is a file hidden?
  
      This only checks the file itself; it should be called in combination with
      checking the directory containing the file.
  
      Use is_hidden() instead to check the file and its parent directories.
  
      Parameters
      ----------
      abs_path : unicode
          The absolute path to check.
      stat_res : os.stat_result, optional
          The result of calling stat() on abs_path. If not passed, this function
          will call stat() internally.
      """
      if os.path.basename(abs_path).startswith("."):
          return True
  
      if stat_res is None or stat.S_ISLNK(stat_res.st_mode):
          try:
              stat_res = os.stat(abs_path)
          except OSError as e:
              if e.errno == errno.ENOENT:
                  return False
              raise
  
      # check that dirs can be listed
      if stat.S_ISDIR(stat_res.st_mode):
          # use x-access, not actual listing, in case of slow/large listings
          if not os.access(abs_path, os.X_OK | os.R_OK):
              return True
  
      # check UF_HIDDEN
      if getattr(stat_res, "st_flags", 0) & UF_HIDDEN:
          return True
  
      return False
  
imports: import os
  import sys
  import stat
  import errno
  import tempfile
  import warnings
  from ipython_genutils import py3compat
  from contextlib import contextmanager
  from distutils.util import strtobool
  from ipython_genutils import py3compat
label_desc: Use image node_id 10 for calling a global function with example usage: is_file_hidden_posix(abs_path, stat_res) and returns: False, True, True, True, False