code: def _validate_shape(
      shape: Union[Tuple[int, ...], torch.Size],
      required_shapes: Tuple[str, ...] = ("BCHW",),
  ) -> None:
      r"""Check if the dtype of the input tensor is in the range of accepted_dtypes
      Args:
          shape: tensor shape
          required_shapes: List. e.g. ["BCHW", "BCDHW"]
      """
      passed = False
      for required_shape in required_shapes:
          if len(shape) == len(required_shape):
              passed = True
              break
      if not passed:
          raise TypeError(
              f"Expected input shape in {required_shape}. Got {shape}."
          )
  
imports: from functools import wraps
  from typing import Any, Callable, Dict, List, Optional, Tuple, Union
  import torch
  from torch.distributions import Beta, Uniform
  from kornia.core import Tensor, as_tensor
  from kornia.geometry.boxes import Boxes
  from kornia.geometry.keypoints import Keypoints
  from kornia.utils import _extract_device_dtype
label_desc: Use image node_id 9 for calling a global function with example usage: _validate_shape(shape, required_shapes) without return types