code: def pid_exists(pid):
      """Check whether pid exists in the current process table."""
      if pid == 0:
          # According to "man 2 kill" PID 0 has a special meaning:
          # it refers to <<every process in the process group of the
          # calling process>> so we don't want to go any further.
          # If we get here it means this UNIX platform *does* have
          # a process with id 0.
          return True
      try:
          os.kill(pid, 0)
      except ProcessLookupError:
          return False
      except PermissionError:
          # EPERM clearly means there's a process to deny access to
          return True
      # According to "man 2 kill" possible error values are
      # (EINVAL, EPERM, ESRCH)
      else:
          return True
  
file_path: catboost/contrib/python/psutil/py3/psutil/_psposix.py
imports: import glob
  import os
  import signal
  import sys
  import time
  from ._common import memoize
  from ._common import sdiskusage
  from ._common import TimeoutExpired
  from ._common import usage_percent
  from ._compat import ChildProcessError
  from ._compat import FileNotFoundError
  from ._compat import InterruptedError
  from ._compat import PermissionError
  from ._compat import ProcessLookupError
  from ._compat import PY3
  from ._compat import unicode
label_desc: Use image node_id 1 for calling a global function with example usage: pid_exists(pid) and returns: True, True, False, True