code: def test_lightning_checkpoint_interval(self):
      with mock_env_with_temp(
          "mmf.trainers.lightning_trainer.get_mmf_env"
      ) as tmp_d:
          # generate checkpoint, val_check_interval=2, checkpoint_inteval=2
          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,
          )
          # this test should generate 3 model files under the modes directory.
          # mmf's directory has model_{2|4|6}.ckpt
          # lightning's directory has model_step={1|3|5}.ckpt
          # this is due to
          # https://github.com/PyTorchLightning/pytorch-lightning/pull/6997
          # also was an issue according to test_validation.py
          files = os.listdir(os.path.join(tmp_d, "models"))
          self.assertEqual(3, len(files))
          indexes = {int(x[:-5].split("=")[1]) for x in files}
          self.assertSetEqual({2, 4, 6}, indexes)
  
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 11 for calling the TestLightningCheckpoint obj's underlying member method code with example usage: obj.test_lightning_checkpoint_interval() without return types