code: def run_lightning_trainer(trainer, on_fit_start_callback=None):
      prepare_lightning_trainer(trainer)
      if on_fit_start_callback:
          on_fit_start_callback()
  
      trainer.trainer.fit(
          trainer.model,
          train_dataloaders=trainer.train_loader,
          val_dataloaders=trainer.val_loader,
      )
      trainer.run_last_validation_after_train()
  
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 8 for calling a global function with example usage: run_lightning_trainer(trainer, on_fit_start_callback) without return types