class_docstr: Class for communicating between a Frontend and a Kernel
class_docstr_tok: ["Class","for","communicating","between","a","Frontend","and","a","Kernel"]
docstr: Initialize a comm.
docstr_tok: ["Initialize","a","comm","."]
code: def __init__(
      self,
      target_name="",
      data=None,
      metadata=None,
      buffers=None,
      show_warning=True,
      **kwargs,
  ):
      """Initialize a comm."""
      if show_warning:
          warn(
              "The `ipykernel.comm.Comm` class has been deprecated. Please use the `comm` module instead."
              "For creating comms, use the function `from comm import create_comm`.",
              DeprecationWarning,
              stacklevel=2,
          )
  
      # Handle differing arguments between base classes.
      had_kernel = "kernel" in kwargs
      kernel = kwargs.pop("kernel", None)
      if target_name:
          kwargs["target_name"] = target_name
      BaseComm.__init__(
          self, data=data, metadata=metadata, buffers=buffers, **kwargs
      )  # type:ignore[call-arg]
      # only re-add kernel if explicitly provided
      if had_kernel:
          kwargs["kernel"] = kernel
      traitlets.config.LoggingConfigurable.__init__(self, **kwargs)
  
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 3 to create a new Comm object from inherited base classes: BaseComm, traitlets.config with example: obj = Comm(target_name, data, metadata, buffers, show_warning)