code: def _validate_snapshot_available() -> None:
      if not _TORCHSNAPSHOT_AVAILABLE:
          raise RuntimeError(
              "TorchSnapshotSaver support requires torchsnapshot. "
              "Please make sure ``torchsnapshot`` is installed. "
              "Installation: https://github.com/pytorch/torchsnapshot#install"
          )
  
imports: from __future__ import annotations
  import logging
  from contextlib import contextmanager, ExitStack
  from typing import Any, Dict, Generator, Iterable, List, Optional, Set, Union
  import torch.distributed
  from torchtnt.framework.callbacks._checkpoint_utils import _prepare_app_state, _prepare_app_state_for_checkpoint, _prepare_app_state_for_restore, _TRAIN_DL_STATE_KEY
  from torchtnt.framework.callbacks.base_checkpointer import BaseCheckpointer
  from torchtnt.framework.callbacks.checkpointer_types import KnobOptions, RestoreOptions
  from torchtnt.framework.state import State
  from torchtnt.framework.unit import AppStateMixin, TEvalUnit, TPredictUnit, TTrainData, TTrainUnit
  from torchtnt.framework.utils import get_timing_context
  from torchtnt.utils.optimizer import init_optim_state
  from torchtnt.utils.rank_zero_log import rank_zero_info, rank_zero_warn
  from torchtnt.utils.stateful import Stateful
label_desc: Use image node_id 1 for calling a global function with example usage: _validate_snapshot_available() without return types