code: def get_mmf_trainer(
      config=None,
      model_size=1,
      num_data_size=100,
      load_model_from_config=False,
      seed=2,
  ):
      torch.random.manual_seed(seed)
      trainer = TrainerTrainingLoopMock(num_data_size, config=config)
  
      if not load_model_from_config:
          add_model(trainer, SimpleModel({"in_dim": model_size}))
      else:
          trainer.load_model()
  
      add_optimizer(trainer, config)
  
      trainer.load_datasets()
      return trainer
  
file_path: mmf/tests/trainers/test_utils.py
imports: import os
  import torch
  from mmf.utils.build import build_optimizer
  from mmf.utils.configuration import load_yaml
  from omegaconf import OmegaConf
  from tests.test_utils import SimpleLightningModel, SimpleModel
  from tests.trainers.lightning.lightning_trainer_mock import LightningTrainerMock
  from tests.trainers.test_trainer_mocks import TrainerTrainingLoopMock
label_desc: Use image node_id 5 for calling a global function with example usage: get_mmf_trainer(config, model_size, num_data_size, load_model_from_config, seed) and returns: trainer