code: def get_size_with_aspect_ratio(self, image_size, size, max_size=None):
      h, w = image_size
      if max_size is not None:
          min_original_size = float(min((w, h)))
          max_original_size = float(max((w, h)))
          if max_original_size / min_original_size * size > max_size:
              size = int(
                  round(
                      max_size * min_original_size / max_original_size
                  )
              )
  
      if (w <= h and w == size) or (h <= w and h == size):
          return (h, w)
  
      if w < h:
          ow = size
          oh = int(size * h / w)
      else:
          oh = size
          ow = int(size * w / h)
  
      return (oh, ow)
  
imports: import random
  from typing import Dict
  import numpy
  from mmcv.transforms.base import BaseTransform
  from mmocr.datasets.transforms import LoadOCRAnnotations
  from mmocr.registry import TASK_UTILS, TRANSFORMS
  from mmocr.utils import bezier2poly, poly2bezier
label_desc: Use image node_id 3 for calling the RescaleToShortSide obj's underlying member method code with example usage: obj.get_size_with_aspect_ratio(image_size, size, max_size) and returns: oh,  ow, h,  w