code: def _format_and_verify_sliding_window_shapes(
      sliding_window_shapes: Union[
          Tuple[int, ...], Tuple[Tuple[int, ...], ...]
      ],
      inputs: Tuple[Tensor, ...],
  ) -> Tuple[Tuple[int, ...], ...]:
      # Formats shapes of sliding windows, which is necessary for occlusion
      # Assumes inputs is already formatted (in tuple)
      if isinstance(sliding_window_shapes[0], int):
          sliding_window_shapes = (sliding_window_shapes,)  # type: ignore
      sliding_window_shapes: Tuple[Tuple[int, ...], ...]
      assert len(sliding_window_shapes) == len(
          inputs
      ), "Must provide sliding window dimensions for each input tensor."
      for i in range(len(inputs)):
          assert (
              isinstance(sliding_window_shapes[i], tuple)
              and len(sliding_window_shapes[i])
              == len(inputs[i].shape) - 1
          ), (
              "Occlusion shape for input index {} is {} but should be a tuple with "
              "{} dimensions."
          ).format(
              i, sliding_window_shapes[i], len(inputs[i].shape) - 1
          )
      return sliding_window_shapes
  
imports: import typing
  from inspect import signature
  from typing import Any, Callable, List, Tuple, TYPE_CHECKING, Union
  import torch
  from captum._utils.common import _format_baseline, _format_output, _format_tensor_into_tuples, _validate_input
  from captum._utils.typing import BaselineType, Literal, TargetType, TensorOrTupleOfTensorsGeneric
  from captum.attr._utils.approximation_methods import SUPPORTED_METHODS
  from torch import Tensor
label_desc: Use image node_id 12 for calling a global function with example usage: _format_and_verify_sliding_window_shapes(sliding_window_shapes, inputs) and returns: sliding_window_shapes