code: def _compute_resized_output_size(
      image_size: Tuple[int, int],
      size: List[int],
      max_size: Optional[int] = None,
  ) -> List[int]:
      if len(size) == 1:  # specified size only for the smallest edge
          h, w = image_size
          short, long = (w, h) if w <= h else (h, w)
          requested_new_short = (
              size if isinstance(size, int) else size[0]
          )
  
          new_short, new_long = requested_new_short, int(
              requested_new_short * long / short
          )
  
          if max_size is not None:
              if max_size <= requested_new_short:
                  raise ValueError(
                      f"max_size = {max_size} must be strictly greater than the requested "
                      f"size for the smaller edge size = {size}"
                  )
              if new_long > max_size:
                  new_short, new_long = (
                      int(max_size * new_short / new_long),
                      max_size,
                  )
  
          new_w, new_h = (
              (new_short, new_long) if w <= h else (new_long, new_short)
          )
      else:  # specified both h and w
          new_w, new_h = size[1], size[0]
      return [new_h, new_w]
  
imports: import math
  import numbers
  import sys
  import warnings
  from enum import Enum
  from typing import Any, List, Optional, Tuple, Union
  import numpy
  import torch
  from PIL import Image
  from torch import Tensor
  from ..utils import _log_api_usage_once
  from .None import _functional_pil, _functional_tensor
label_desc: Use image node_id 12 for calling a global function with example usage: _compute_resized_output_size(image_size, size, max_size) and returns: list