code: def catch_trainer_kwargs(model):
      with mock.patch("lightning.pytorch.Trainer") as mock_trainer:
          try:
              model.fit(
                  train_data=DUMMY_TS_DATAFRAME,
                  val_data=DUMMY_TS_DATAFRAME,
              )
          except IsADirectoryError:
              # Training fails because Trainer is a mock object
              pass
      return mock_trainer.call_args[1]
  
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 17 for calling a global function with example usage: catch_trainer_kwargs(model) and returns: mock_trainer