code: def test_load_trainer_resume_parity_with_mmf(self):
      # directly setting lightning's trainer param: resume_from_checkpoint
      filename = "current.ckpt"
      mmf_ckpt_current = self._get_mmf_ckpt(
          filename, ckpt_config={"resume": True}
      )
  
      with mock_env_with_temp(
          "mmf.trainers.lightning_trainer.get_mmf_env"
      ) as tmp_d:
          lightning = self._get_lightning_trainer(max_steps=6)
          lightning.trainer.fit(
              lightning.model, train_dataloaders=lightning.train_loader
          )
  
          lightning = self._get_lightning_trainer(
              max_steps=6,
              resume_from_checkpoint=os.path.join(tmp_d, filename),
          )
          lightning.trainer.fit(
              lightning.model, train_dataloaders=lightning.train_loader
          )
          lightning_ckpt_current = torch.load(
              os.path.join(tmp_d, filename)
          )
          self._assert_same_dict(
              lightning_ckpt_current["state_dict"],
              lightning.model.state_dict(),
          )
  
      # Make sure lightning and mmf parity
      self._assert_same_dict(
          mmf_ckpt_current["model"],
          lightning_ckpt_current["state_dict"],
      )
  
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 7 for calling the TestLightningCheckpoint obj's underlying member method code with example usage: obj.test_load_trainer_resume_parity_with_mmf() without return types