code: def test_latest_checkpoint_path(self) -> None:
      with tempfile.TemporaryDirectory() as temp_dir:
          self.assertIsNone(get_latest_checkpoint_path(temp_dir))
  
      with tempfile.TemporaryDirectory() as temp_dir:
          latest_path = os.path.join(temp_dir, "epoch_0_step_0")
          os.mkdir(latest_path)
          self.assertEqual(
              get_latest_checkpoint_path(temp_dir),
              latest_path,
          )
          self.assertEqual(
              get_latest_checkpoint_path(temp_dir, METADATA_FNAME),
              None,
          )
          self._create_snapshot_metadata(latest_path)
          self.assertEqual(
              get_latest_checkpoint_path(temp_dir, METADATA_FNAME),
              latest_path,
          )
  
      with tempfile.TemporaryDirectory() as temp_dir:
          path_1 = os.path.join(temp_dir, "epoch_0_step_0")
          os.mkdir(path_1)
          self._create_snapshot_metadata(path_1)
          path_2 = os.path.join(temp_dir, "epoch_0_step_100")
          os.mkdir(path_2)
          self._create_snapshot_metadata(path_2)
  
          # Missing metadata file
          path_3 = os.path.join(temp_dir, "epoch_1_step_100")
          os.mkdir(path_3)
  
          # Ill-formatted name
          path_4 = os.path.join(temp_dir, "epoch_700")
          os.mkdir(path_4)
          self.assertEqual(
              get_latest_checkpoint_path(temp_dir, METADATA_FNAME),
              path_2,
          )
  
imports: import os
  import shutil
  import tempfile
  import unittest
  import torch
  import torch.distributed
  from torch import nn
  from torch.distributed import launcher
  from torchsnapshot import Snapshot
  from torchsnapshot.snapshot import SNAPSHOT_METADATA_FNAME
  from torchtnt.framework._test_utils import DummyTrainUnit, get_dummy_train_state
  from torchtnt.framework.callbacks._checkpoint_utils import _delete_checkpoint, _metadata_exists, _prepare_app_state_for_checkpoint, _retrieve_checkpoint_dirpaths, get_checkpoint_dirpaths, get_latest_checkpoint_path, rank_zero_read_and_broadcast
  from torchtnt.utils.distributed import get_global_rank, PGWrapper
  from torchtnt.utils.env import init_from_env
  from torchtnt.utils.fsspec import get_filesystem
  from torchtnt.utils.test_utils import get_pet_launch_config, spawn_multi_process
label_desc: Use image node_id 2 for calling the CheckpointUtilsTest obj's underlying member method code with example usage: obj.test_latest_checkpoint_path() without return types