class_docstr: The base class for comms.
class_docstr_tok: ["The","base","class","for","comms","."]
docstr: Helper for sending a comm message on IOPub
docstr_tok: ["Helper","for","sending","a","comm","message","on","IOPub"]
code: def publish_msg(
      self, msg_type, data=None, metadata=None, buffers=None, **keys
  ):
      """Helper for sending a comm message on IOPub"""
      if not Kernel.initialized():
          return
  
      data = {} if data is None else data
      metadata = {} if metadata is None else metadata
      content = json_clean(
          dict(data=data, comm_id=self.comm_id, **keys)
      )
  
      if self.kernel is None:
          self.kernel = Kernel.instance()
  
      assert self.kernel.session is not None
      self.kernel.session.send(
          self.kernel.iopub_socket,
          msg_type,
          content,
          metadata=json_clean(metadata),
          parent=self.kernel.get_parent(),
          ident=self.topic,
          buffers=buffers,
      )
  
file_path: catboost/contrib/python/ipykernel/py3/ipykernel/comm/comm.py
imports: import uuid
  from typing import Optional
  from warnings import warn
  import comm.base_comm
  import traitlets.config
  from traitlets import Bool, Bytes, Instance, Unicode, default
  from ipykernel.jsonutil import json_clean
  from ipykernel.kernelbase import Kernel
label_desc: Use image node_id 1 for calling the BaseComm obj's underlying member method code with example usage: obj.publish_msg(msg_type, data, metadata, buffers) without return types