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().__getattr__(attr)  # type:ignore[misc]
      assert self.io_thread is not None
      if hasattr(self.io_thread.socket, attr):
          warnings.warn(
              f"Accessing zmq Socket attribute {attr} on BackgroundSocket"
              f" is deprecated since ipykernel 4.3.0"
              f" use .io_thread.socket.{attr}",
              DeprecationWarning,
              stacklevel=2,
          )
          return getattr(self.io_thread.socket, attr)
      return super().__getattr__(attr)
  
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 2 for calling the BackgroundSocket obj's underlying member method code with example usage: obj.__getattr__(attr) and returns: super, getattr