code: def test_load_partial_checkpoint(self):
      with contextlib.redirect_stdout(StringIO()):
          trainer, epoch_itr = get_trainer_and_epoch_itr(
              2, 150, 200, 50
          )
          trainer.get_train_iterator = MagicMock(return_value=epoch_itr)
  
          _, epoch_itr = checkpoint_utils.load_checkpoint(
              self.cfg_mock.checkpoint, trainer
          )
  
          self.assertEqual(epoch_itr.epoch, 2)
          self.assertEqual(epoch_itr.iterations_in_epoch, 50)
  
          itr = epoch_itr.next_epoch_itr(shuffle=False)
          self.assertEqual(epoch_itr.epoch, 2)
          self.assertEqual(epoch_itr.iterations_in_epoch, 50)
  
          self.assertEqual(
              next(itr)["net_input"]["src_tokens"][0].item(), 50
          )
          self.assertEqual(epoch_itr.iterations_in_epoch, 51)
  
          for _ in range(150 - 52):
              next(itr)
          self.assertEqual(epoch_itr.iterations_in_epoch, 149)
          self.assertTrue(itr.has_next())
          next(itr)
          self.assertFalse(itr.has_next())
  
          itr = epoch_itr.next_epoch_itr(shuffle=False)
          self.assertTrue(itr.has_next())
          self.assertEqual(epoch_itr.epoch, 3)
          self.assertEqual(epoch_itr.iterations_in_epoch, 0)
  
imports: import contextlib
  import logging
  import unittest
  from io import StringIO
  from unittest.mock import MagicMock, patch
  import torch
  from fairseq import checkpoint_utils, data
  from omegaconf import OmegaConf
label_desc: Use image node_id 3 for calling the TestLoadCheckpoint obj's underlying member method code with example usage: obj.test_load_partial_checkpoint() without return types