class_docstr: Manager for Comms in the Kernel
class_docstr_tok: ["Manager","for","Comms","in","the","Kernel"]
docstr: Handler for comm_open messages
docstr_tok: ["Handler","for","comm_open","messages"]
code: def comm_open(self, stream, ident, msg):
      """Handler for comm_open messages"""
      content = msg["content"]
      comm_id = content["comm_id"]
      target_name = content["target_name"]
      f = self.targets.get(target_name, None)
      comm = Comm(
          comm_id=comm_id,
          primary=False,
          target_name=target_name,
      )
      self.register_comm(comm)
      if f is None:
          self.log.error(
              "No such comm target registered: %s", target_name
          )
      else:
          try:
              f(comm, msg)
              return
          except Exception:
              self.log.error(
                  "Exception opening comm with target: %s",
                  target_name,
                  exc_info=True,
              )
  
      # Failure.
      try:
          comm.close()
      except:
          self.log.error(
              """Could not close comm during `comm_open` failure
                  clean-up.  The comm may not have been opened yet.""",
              exc_info=True,
          )
  
file_path: catboost/contrib/python/ipykernel/py2/ipykernel/comm/manager.py
imports: import sys
  import logging
  from traitlets.config import LoggingConfigurable
  from ipython_genutils.importstring import import_item
  from ipython_genutils.py3compat import string_types
  from traitlets import Instance, Unicode, Dict, Any, default
  from .comm import Comm
label_desc: Use image node_id 6 for calling the CommManager obj's underlying member method code with example usage: obj.comm_open(stream, ident, msg) without return types