class_docstr: Wrapper around IOPub thread that provides zmq send[_multipart]
class_docstr_tok: ["Wrapper","around","IOPub","thread","that","provides","zmq","send","[","_multipart","]"]
docstr: Set an attribute on the socket.
code: def __setattr__(self, attr, value):
      """Set an attribute on the socket."""
      if attr == "io_thread" or (
          attr.startswith("__") and attr.endswith("__")
      ):
          super().__setattr__(attr, value)
      else:
          warnings.warn(
              f"Setting zmq Socket attribute {attr} on BackgroundSocket"
              f" is deprecated since ipykernel 4.3.0"
              f" use .io_thread.socket.{attr}",
              DeprecationWarning,
              stacklevel=2,
          )
          assert self.io_thread is not None
          setattr(self.io_thread.socket, attr, value)
  
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 3 for calling the BackgroundSocket obj's underlying member method code with example usage: obj.__setattr__(attr, value) without return types