code: def test_load_trainer_ckpt_number_of_steps(self):
      with mock_env_with_temp(
          "mmf.trainers.lightning_trainer.get_mmf_env"
      ) as tmp_d:
          # to generate ckpt file, max_steps is saved as 6
          lightning_gen = self._get_lightning_trainer(max_steps=6)
          lightning_gen.trainer.fit(
              lightning_gen.model,
              train_dataloaders=lightning_gen.train_loader,
              val_dataloaders=lightning_gen.val_loader,
          )
  
          # load ckpt file using resume_file, and train with max_steps 12
          resume_file = os.path.join(tmp_d, "current.ckpt")
          lightning = self._get_lightning_trainer(
              model_config={"simple_lightning_model": {"in_dim": 1}},
              resume_from_checkpoint=resume_file,
              seed=4,
              max_steps=12,
          )
  
          # training will take place 6 times.
          with patch.object(
              LightningLoopCallback,
              "on_train_batch_end",
              return_value=None,
          ) as mock_method:
              lightning.trainer.fit(
                  lightning.model,
                  train_dataloaders=lightning.train_loader,
              )
              self.assertEqual(lightning.trainer.global_step, 12)
              call_args_list = [
                  l[0][4] for l in mock_method.call_args_list
              ]
              # in lightning 1.6.0 last batch idx from ckpt is repeated
              self.assertListEqual(list(range(5, 11)), call_args_list)
  
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 8 for calling the TestLightningCheckpoint obj's underlying member method code with example usage: obj.test_load_trainer_ckpt_number_of_steps() without return types