code: def _delete_checkpoint(
      dirpath: str, metadata_fname: Optional[str] = None
  ) -> None:
      fs = get_filesystem(dirpath)
      if metadata_fname and not _metadata_exists(
          fs, dirpath, metadata_fname
      ):
          raise RuntimeError(
              f"{dirpath} does not contain {metadata_fname}"
          )
      fs.rm(dirpath, recursive=True)
  
imports: import logging
  import os
  import re
  from typing import Any, Callable, cast, Dict, List, Optional, Pattern, Tuple, TypeVar
  import fsspec
  from pyre_extensions import none_throws
  from torch import distributed
  from torchtnt.framework.callbacks.checkpointer_types import RestoreOptions
  from torchtnt.framework.state import State
  from torchtnt.framework.unit import AppStateMixin
  from torchtnt.utils.distributed import get_global_rank, PGWrapper
  from torchtnt.utils.fsspec import get_filesystem
  from torchtnt.utils.stateful import Stateful
label_desc: Use image node_id 6 for calling a global function with example usage: _delete_checkpoint(dirpath, metadata_fname) without return types