class_docstr: An object for sending IOPub messages in a background thread
  
  Prevents a blocking main thread from delaying output from threads.
  
  IOPubThread(pub_socket).background_socket is a Socket-API-providing object
  whose IO is always run in a thread.
class_docstr_tok: ["An","object","for","sending","IOPub","messages","in","a","background","thread","Prevents","a","blocking","main","thread","from","delaying","output","from","threads",".","IOPubThread","(","pub_socket",")",".background_socket","is","a","Socket-API-providing","object","whose","IO","is","always","run","in","a","thread","."]
docstr: setup listening pipe for IOPub from forked subprocesses
code: def _setup_pipe_in(self):
      """setup listening pipe for IOPub from forked subprocesses"""
      ctx = self.socket.context
  
      # use UUID to authenticate pipe messages
      self._pipe_uuid = os.urandom(16)
  
      pipe_in = ctx.socket(zmq.PULL)
      pipe_in.linger = 0
  
      try:
          self._pipe_port = pipe_in.bind_to_random_port(
              "tcp://127.0.0.1"
          )
      except zmq.ZMQError as e:
          warnings.warn(
              "Couldn't bind IOPub Pipe to 127.0.0.1: %s" % e
              + "\nsubprocess output will be unavailable."
          )
          self._pipe_flag = False
          pipe_in.close()
          return
      self._pipe_in = ZMQStream(pipe_in, self.io_loop)
      self._pipe_in.on_recv(self._handle_pipe_msg)
  
imports: from __future__ import print_function
  import atexit
  from binascii import b2a_hex
  from collections import deque
  import os
  import sys
  import threading
  import warnings
  from io import StringIO, TextIOBase
  import zmq
  from zmq.eventloop.ioloop import IOLoop
  from zmq.eventloop.zmqstream import ZMQStream
  from jupyter_client.session import extract_header
  from ipython_genutils import py3compat
  from ipython_genutils.py3compat import unicode_type
label_desc: Use image node_id 6 for calling the IOPubThread obj's underlying member method code with example usage: obj._setup_pipe_in() without return types