class_docstr: Wrapper around IOPub thread that provides zmq send[_multipart]
class_docstr_tok: ["Wrapper","around","IOPub","thread","that","provides","zmq","send","[","_multipart","]"]
docstr: Wrap socket attr access for backward-compatibility
code: def __getattr__(self, attr):
      """Wrap socket attr access for backward-compatibility"""
      if attr.startswith("__") and attr.endswith("__"):
          # don't wrap magic methods
          super(BackgroundSocket, self).__getattr__(attr)
      if hasattr(self.io_thread.socket, attr):
          warnings.warn(
              "Accessing zmq Socket attribute %s on BackgroundSocket"
              % attr,
              DeprecationWarning,
              stacklevel=2,
          )
          return getattr(self.io_thread.socket, attr)
      super(BackgroundSocket, self).__getattr__(attr)
  
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 2 for calling the BackgroundSocket obj's underlying member method code with example usage: obj.__getattr__(attr) and returns: getattr