code: def test_when_custom_trainer_kwargs_given_then_trainer_receives_them():
      trainer_kwargs = {"max_epochs": 5, "limit_train_batches": 100}
      model = PatchTSTModel(
          hyperparameters={
              "trainer_kwargs": trainer_kwargs,
              **DUMMY_HYPERPARAMETERS,
          }
      )
      received_trainer_kwargs = catch_trainer_kwargs(model)
      for k, v in trainer_kwargs.items():
          assert received_trainer_kwargs[k] == v
  
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 21 for calling a global function with example usage: test_when_custom_trainer_kwargs_given_then_trainer_receives_them() without return types