code: def _assert_same(self, obj1, obj2, same=True):
      if same:
          if hasattr(obj1, "mean") and obj1.dtype == torch.float:
              self.assertAlmostEqual(
                  obj1.mean().item(), obj2.mean().item(), 2
              )
          elif hasattr(obj1, "item"):
              self.assertEqual(obj1.item(), obj2.item())
          elif type(obj1) is dict and type(obj2) is dict:
              self._assert_same_dict(obj1, obj2)
          else:
              self.assertEqual(obj1, obj2)
      else:
          if hasattr(obj1, "mean") and obj1.dtype == torch.float:
              self.assertNotEqual(
                  obj1.mean().item(), obj2.mean().item()
              )
          elif hasattr(obj1, "item"):
              self.assertNotEqual(obj1.item(), obj2.item())
          elif type(obj1) is dict and type(obj2) is dict:
              self._assert_same_dict(obj1, obj2, same=False)
          else:
              self.assertNotEqual(obj1, obj2)
  
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 2 for calling the TestLightningCheckpoint obj's underlying member method code with example usage: obj._assert_same(obj1, obj2, same) without return types