class_docstr: A Unix-specific daemon thread that terminates the program immediately
  when the parent process no longer exists.
class_docstr_tok: ["A","Unix-specific","daemon","thread","that","terminates","the","program","immediately","when","the","parent","process","no","longer","exists","."]
docstr: Run the poller.
docstr_tok: ["Run","the","poller","."]
code: def run(self):
      """Run the poller."""
      # We cannot use os.waitpid because it works only for child processes.
      from errno import EINTR
  
      while True:
          try:
              if os.getppid() == 1:
                  get_logger().warning(
                      "Parent appears to have exited, shutting down."
                  )
                  os._exit(1)
              time.sleep(1.0)
          except OSError as e:
              if e.errno == EINTR:
                  continue
              raise
  
file_path: catboost/contrib/python/ipykernel/py3/ipykernel/parentpoller.py
imports: import os
  import platform
  import signal
  import time
  import warnings
  from _thread import interrupt_main
  from threading import Thread
  from traitlets.log import get_logger
label_desc: Use image node_id 2 for calling the ParentPollerUnix obj's underlying member method code with example usage: obj.run() without return types