code: def get_image_height_and_width(
      image_size: int | tuple | None = None,
  ) -> tuple[int | None, int | None]:
      """Get image height and width from ``image_size`` variable.
  
      Args:
          image_size (int | tuple | None, optional): Input image size.
  
      Raises:
          ValueError: Image size not None, int or tuple.
  
      Examples:
          >>> get_image_height_and_width(image_size=256)
          (256, 256)
  
          >>> get_image_height_and_width(image_size=(256, 256))
          (256, 256)
  
          >>> get_image_height_and_width(image_size=(256, 256, 3))
          (256, 256)
  
          >>> get_image_height_and_width(image_size=256.)
          Traceback (most recent call last):
          File "<string>", line 1, in <module>
          File "<string>", line 18, in get_image_height_and_width
          ValueError: ``image_size`` could be either int or tuple[int, int]
  
      Returns:
          tuple[int | None, int | None]: A tuple containing image height and width values.
      """
      height_and_width: tuple[int | None, int | None]
      if isinstance(image_size, int):
          height_and_width = (image_size, image_size)
      elif isinstance(image_size, tuple):
          height_and_width = int(image_size[0]), int(image_size[1])
      elif image_size is None:
          height_and_width = (None, None)
      else:
          raise ValueError(
              "``image_size`` could be either int or tuple[int, int]"
          )
  
      return height_and_width
  
file_path: anomalib/src/anomalib/pre_processing/pre_process.py
imports: from __future__ import annotations
  import logging
  import warnings
  from typing import Any
  import albumentations
  from albumentations.pytorch import ToTensorV2
label_desc: Use image node_id 1 for calling a global function with example usage: get_image_height_and_width(image_size) and returns: height_and_width