class_docstr: Class for communicating between a Frontend and a Kernel
class_docstr_tok: ["Class","for","communicating","between","a","Frontend","and","a","Kernel"]
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"""
      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)
      )
      self.kernel.session.send(
          self.kernel.iopub_socket,
          msg_type,
          content,
          metadata=json_clean(metadata),
          parent=self.kernel._parent_header,
          ident=self.topic,
          buffers=buffers,
      )
  
file_path: catboost/contrib/python/ipykernel/py2/ipykernel/comm/comm.py
imports: import uuid
  from traitlets.config import LoggingConfigurable
  from ipykernel.kernelbase import Kernel
  from ipykernel.jsonutil import json_clean
  from traitlets import Instance, Unicode, Bytes, Bool, Dict, Any, default
label_desc: Use image node_id 5 for calling the Comm obj's underlying member method code with example usage: obj._publish_msg(msg_type, data, metadata, buffers) without return types