code: def test_when_custom_callbacks_passed_via_trainer_kwargs_then_trainer_receives_them():
      from lightning.pytorch.callbacks import RichModelSummary
  
      callback = RichModelSummary()
      model = DLinearModel(
          hyperparameters={
              "trainer_kwargs": {"callbacks": [callback]},
              **DUMMY_HYPERPARAMETERS,
          }
      )
      received_trainer_kwargs = catch_trainer_kwargs(model)
      assert any(
          isinstance(cb, RichModelSummary)
          for cb in received_trainer_kwargs["callbacks"]
      )
  
imports: from unittest import mock
  import numpy
  import pytest
  from gluonts.model.predictor import Predictor
  from autogluon.timeseries.models.gluonts import DeepARModel, DLinearModel, PatchTSTModel, SimpleFeedForwardModel, TemporalFusionTransformerModel, WaveNetModel
  from autogluon.timeseries.utils.features import TimeSeriesFeatureGenerator
  from ..common import DATAFRAME_WITH_COVARIATES, DATAFRAME_WITH_STATIC, DUMMY_TS_DATAFRAME
label_desc: Use image node_id 18 for calling a global function with example usage: test_when_custom_callbacks_passed_via_trainer_kwargs_then_trainer_receives_them() without return types