code: def _is_pid_running_on_unix(pid):
      
      try:
          os.kill(pid, 0)
      except OSError as err:
          # if error is ESRCH, it means the process doesn't exist
          return not err.errno == os.errno.ESRCH
      return True
docs: Check if PID is running for Unix systems.