code: def _configure_model_summary_callback(
      self, enable_model_summary: bool
  ) -> None:
      if not enable_model_summary:
          return
  
      model_summary_cbs = [
          type(cb)
          for cb in self.trainer.callbacks
          if isinstance(cb, ModelSummary)
      ]
      if model_summary_cbs:
          rank_zero_info(
              f"Trainer already configured with model summary callbacks: {model_summary_cbs}."
              " Skipping setting a default `ModelSummary` callback."
          )
          return
  
      progress_bar_callback = self.trainer.progress_bar_callback
      is_progress_bar_rich = isinstance(
          progress_bar_callback, RichProgressBar
      )
  
      model_summary: ModelSummary
      if progress_bar_callback is not None and is_progress_bar_rich:
          model_summary = RichModelSummary()
      else:
          model_summary = ModelSummary()
      self.trainer.callbacks.append(model_summary)
  
imports: import logging
  import os
  from datetime import timedelta
  from typing import Dict, List, Optional, Sequence, Union
  import lightning.pytorch
  from lightning.fabric.utilities.registry import _load_external_callbacks
  from lightning.pytorch.callbacks import Callback, Checkpoint, ModelCheckpoint, ModelSummary, ProgressBar, RichProgressBar, TQDMProgressBar
  from lightning.pytorch.callbacks.batch_size_finder import BatchSizeFinder
  from lightning.pytorch.callbacks.lr_finder import LearningRateFinder
  from lightning.pytorch.callbacks.rich_model_summary import RichModelSummary
  from lightning.pytorch.callbacks.timer import Timer
  from lightning.pytorch.trainer import call
  from lightning.pytorch.utilities.exceptions import MisconfigurationException
  from lightning.pytorch.utilities.model_helpers import is_overridden
  from lightning.pytorch.utilities.rank_zero import rank_zero_info
label_desc: Use image node_id 4 for calling the _CallbackConnector obj's underlying member method code with example usage: obj._configure_model_summary_callback(enable_model_summary) without return types