code: def is_executable_file(path):
      """Checks that path is an executable regular file, or a symlink towards one.
  
      This is roughly ``os.path isfile(path) and os.access(path, os.X_OK)``.
      """
      # follow symlinks,
      fpath = os.path.realpath(path)
  
      if not os.path.isfile(fpath):
          # non-files (directories, fifo, etc.)
          return False
  
      mode = os.stat(fpath).st_mode
  
      if sys.platform.startswith("sunos") and os.getuid() == 0:
          # When root on Solaris, os.X_OK is True for *all* files, irregardless
          # of their executability -- instead, any permission bit of any user,
          # group, or other is fine enough.
          #
          # (This may be true for other "Unix98" OS's such as HP-UX and AIX)
          return bool(
              mode & (stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)
          )
  
      return os.access(fpath, os.X_OK)
  
file_path: catboost/contrib/python/pexpect/py2/pexpect/utils.py
imports: import os
  import sys
  import stat
  import select
  import time
  import errno
label_desc: Use image node_id 1 for calling a global function with example usage: is_executable_file(path) and returns: os, False, bool