code: def test_attach_model_callbacks_override_info(caplog):
      """Test that the logs contain the info about overriding callbacks returned by configure_callbacks."""
      model = LightningModule()
      model.configure_callbacks = lambda: [
          LearningRateMonitor(),
          EarlyStopping(monitor="foo"),
      ]
      trainer = Trainer(
          enable_checkpointing=False,
          callbacks=[
              EarlyStopping(monitor="foo"),
              LearningRateMonitor(),
              TQDMProgressBar(),
          ],
      )
      trainer.strategy._lightning_module = model
      cb_connector = _CallbackConnector(trainer)
      with caplog.at_level(logging.INFO):
          cb_connector._attach_model_callbacks()
  
      assert (
          "existing callbacks passed to Trainer: EarlyStopping, LearningRateMonitor"
          in caplog.text
      )
  
imports: import contextlib
  import logging
  from unittest import mock
  from unittest.mock import Mock
  import pytest
  import torch
  from lightning.fabric.utilities.imports import _PYTHON_GREATER_EQUAL_3_8_0, _PYTHON_GREATER_EQUAL_3_10_0
  from lightning.pytorch import Callback, LightningModule, Trainer
  from lightning.pytorch.callbacks import EarlyStopping, GradientAccumulationScheduler, LearningRateMonitor, ModelCheckpoint, ModelSummary, ProgressBar, TQDMProgressBar
  from lightning.pytorch.callbacks.batch_size_finder import BatchSizeFinder
  from lightning.pytorch.demos.boring_classes import BoringModel
  from lightning.pytorch.trainer.connectors.callback_connector import _CallbackConnector
label_desc: Use image node_id 4 for calling a global function with example usage: test_attach_model_callbacks_override_info(caplog) without return types