code: def _get_mmf_trainer(
      self, ckpt_config=None, model_config=None, seed=2, max_updates=6
  ):
      config = self._get_ckpt_config(
          ckpt_config=ckpt_config, max_steps=max_updates
      )
  
      load_model_from_config = False
      if model_config:
          config.model_config = model_config
          config.model = list(model_config.keys())[0]
          load_model_from_config = True
  
      mmf_trainer = get_mmf_trainer(
          config=config,
          load_model_from_config=load_model_from_config,
          seed=seed,
      )
      mmf_trainer.load_metrics()
  
      checkpoint_callback = CheckpointCallback(config, mmf_trainer)
      mmf_trainer.on_init_start = checkpoint_callback.on_init_start
      mmf_trainer.on_train_end = checkpoint_callback.on_train_end
      mmf_trainer.callbacks.append(checkpoint_callback)
      mmf_trainer.checkpoint_callback = checkpoint_callback
  
      mmf_trainer.lr_scheduler_callback = None
  
      early_stop_callback = EarlyStoppingCallback(config, mmf_trainer)
      mmf_trainer.early_stop_callback = early_stop_callback
      mmf_trainer.callbacks.append(early_stop_callback)
  
      return mmf_trainer
  
imports: import contextlib
  import os
  import tempfile
  import unittest
  from unittest.mock import patch
  import torch
  from mmf.trainers.callbacks.checkpoint import CheckpointCallback
  from mmf.trainers.callbacks.early_stopping import EarlyStoppingCallback
  from mmf.trainers.lightning_core.loop_callback import LightningLoopCallback
  from mmf.utils.checkpoint import get_ckpt_path_from_folder
  from mmf.utils.download import download_pretrained_model
  from tests.test_utils import skip_if_no_network
  from tests.trainers.test_utils import get_config_with_defaults, get_lightning_trainer, get_mmf_trainer, prepare_lightning_trainer
label_desc: Use image node_id 4 for calling the TestLightningCheckpoint obj's underlying member method code with example usage: obj._get_mmf_trainer(ckpt_config, model_config, seed, max_updates) and returns: mmf_trainer