class_docstr: Monitor for an output stream (stdout or stderr) of a child process.
  
  This class serves multiple purposes:
  - Collects output from the child process in a rolling buffer in the
    background, and makes it available in a thread-safe manner.
  - Causes the current process to exit when the child process closes the
    stream (i.e. when the child process exits).
class_docstr_tok: ["Monitor","for","an","output","stream","(","stdout","or","stderr",")","of","a","child","process",".","This","class","serves","multiple","purposes",":","-","Collects","output","from","the","child","process","in","a","rolling","buffer","in","the","background",",","and","makes","it","available","in","a","thread-safe","manner",".","-","Causes","the","current","process","to","exit","when","the","child","process","closes","the","stream","(","i.e",".","when","the","child","process","exits",")","."]
code: def __init__(self, stream):
      self.stream = stream
      self.output_deque = collections.deque(maxlen=4)
  
      thread = threading.Thread(target=self._run_monitor_thread)
      thread.start()
  
imports: import argparse
  import collections
  import enum
  import os
  import signal
  import subprocess
  import sys
  import threading
  import traceback
  import psutil
  from fiftyone.service.ipc import IPCServer
label_desc: Use image node_id 1 to create a new ChildStreamMonitor object from inherited base classes: object with example: obj = ChildStreamMonitor(stream)