code: def on_trainer_init(
      self,
      callbacks: Optional[Union[List[Callback], Callback]],
      enable_checkpointing: bool,
      enable_progress_bar: bool,
      default_root_dir: Optional[str],
      enable_model_summary: bool,
      max_time: Optional[Union[str, timedelta, Dict[str, int]]] = None,
  ) -> None:
      # init folder paths for checkpoint + weights save callbacks
      self.trainer._default_root_dir = default_root_dir or os.getcwd()
  
      # init callbacks
      if isinstance(callbacks, Callback):
          callbacks = [callbacks]
      self.trainer.callbacks = callbacks or []
  
      # configure checkpoint callback
      # pass through the required args to figure out defaults
      self._configure_checkpoint_callbacks(enable_checkpointing)
  
      # configure the timer callback.
      # responsible to stop the training when max_time is reached.
      self._configure_timer_callback(max_time)
  
      # init progress bar
      self._configure_progress_bar(enable_progress_bar)
  
      # configure the ModelSummary callback
      self._configure_model_summary_callback(enable_model_summary)
  
      self.trainer.callbacks.extend(
          _load_external_callbacks(
              "lightning.pytorch.callbacks_factory"
          )
      )
      _validate_callbacks_list(self.trainer.callbacks)
  
      # push all model checkpoint callbacks to the end
      # it is important that these are the last callbacks to run
      self.trainer.callbacks = self._reorder_callbacks(
          self.trainer.callbacks
      )
  
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 2 for calling the _CallbackConnector obj's underlying member method code with example usage: obj.on_trainer_init(callbacks, enable_checkpointing, enable_progress_bar, default_root_dir, enable_model_summary, max_time) without return types