class_docstr: A file like object that publishes the stream to a 0MQ PUB socket.
  
  Output is handed off to an IO Thread
class_docstr_tok: ["A","file","like","object","that","publishes","the","stream","to","a","0MQ","PUB","socket",".","Output","is","handed","off","to","an","IO","Thread"]
code: def _setup_stream_redirects(self, name):
      pr, pw = os.pipe()
      fno = self._original_stdstream_fd = getattr(sys, name).fileno()
      self._original_stdstream_copy = os.dup(fno)
      os.dup2(pw, fno)
  
      self._fid = pr
  
      self._exc = None
      self.watch_fd_thread = threading.Thread(
          target=self._watch_pipe_fd
      )
      self.watch_fd_thread.daemon = True
      self.watch_fd_thread.start()
  
imports: import asyncio
  import atexit
  import io
  import os
  import sys
  import threading
  import traceback
  import warnings
  from binascii import b2a_hex
  from collections import deque
  from io import StringIO, TextIOBase
  from threading import local
  from typing import Any, Callable, Deque, Dict, Optional
  import zmq
  from jupyter_client.session import extract_header
  from tornado.ioloop import IOLoop
  from zmq.eventloop.zmqstream import ZMQStream
label_desc: Use image node_id 5 for calling the OutStream obj's underlying member method code with example usage: obj._setup_stream_redirects(name) without return types