code: def get_resize_output_image_size(
      input_image: np.ndarray,
      size: Union[int, Tuple[int, int], List[int]],
      max_size: Optional[int] = None,
      input_data_format: Optional[Union[str, ChannelDimension]] = None,
  ) -> Tuple[int, int]:
      """
      Computes the output image size given the input image size and the desired output size. If the desired output size
      is a tuple or list, the output image size is returned as is. If the desired output size is an integer, the output
      image size is computed by keeping the aspect ratio of the input image size.
  
      Args:
          input_image (`np.ndarray`):
              The image to resize.
          size (`int` or `Tuple[int, int]` or `List[int]`):
              The desired output size.
          max_size (`int`, *optional*):
              The maximum allowed output size.
          input_data_format (`ChannelDimension` or `str`, *optional*):
              The channel dimension format of the input image. If not provided, it will be inferred from the input image.
      """
      image_size = get_image_size(input_image, input_data_format)
      if isinstance(size, (list, tuple)):
          return size
  
      return get_size_with_aspect_ratio(image_size, size, max_size)
  
imports: import io
  import pathlib
  from collections import defaultdict
  from typing import Any, Callable, Dict, Iterable, List, Optional, Set, Tuple, Union
  import numpy
  from ...image_processing_utils import BaseImageProcessor, BatchFeature, get_size_dict
  from ...image_transforms import PaddingMode, center_to_corners_format, corners_to_center_format, id_to_rgb, pad, rescale, resize, rgb_to_id, to_channel_dimension_format
  from ...image_utils import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD, AnnotationFormat, AnnotationType, ChannelDimension, ImageInput, PILImageResampling, get_image_size, infer_channel_dimension_format, is_scaled_image, make_list_of_images, to_numpy_array, valid_images, validate_annotations
  from ...utils import TensorType, is_flax_available, is_jax_tensor, is_scipy_available, is_tf_available, is_tf_tensor, is_torch_available, is_torch_tensor, is_vision_available, logging
label_desc: Use image node_id 2 for calling a global function with example usage: get_resize_output_image_size(input_image, size, max_size, input_data_format) and returns: get_size_with_aspect_ratio, size