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"]
docstr: Registers a hook with the thread-local storage.
  
  Parameters
  ----------
  hook : Any callable object
  
  Returns
  -------
  Either a publishable message, or `None`.
  The hook callable must return a message from
  the __call__ method if they still require the
  `session.send` method to be called after transformation.
  Returning `None` will halt that execution path, and
  session.send will not be called.
code: def register_hook(self, hook):
      """
      Registers a hook with the thread-local storage.
  
      Parameters
      ----------
      hook : Any callable object
  
      Returns
      -------
      Either a publishable message, or `None`.
      The hook callable must return a message from
      the __call__ method if they still require the
      `session.send` method to be called after transformation.
      Returning `None` will halt that execution path, and
      session.send will not be called.
      """
      self._hooks.append(hook)
  
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 19 for calling the OutStream obj's underlying member method code with example usage: obj.register_hook(hook) without return types