code: def scale(size, image):
      """
      Scale the short side of the image to size.
      Args:
          size (int): size to scale the image.
          image (array): image to perform short side scale. Dimension is
              `height` x `width` x `channel`.
      Returns:
          (ndarray): the scaled image with dimension of
              `height` x `width` x `channel`.
      """
      height = image.shape[0]
      width = image.shape[1]
      if (width <= height and width == size) or (
          height <= width and height == size
      ):
          return image
      new_width = size
      new_height = size
      if width < height:
          new_height = int(math.floor((float(height) / width) * size))
      else:
          new_width = int(math.floor((float(width) / height) * size))
      img = cv2.resize(
          image, (new_width, new_height), interpolation=cv2.INTER_LINEAR
      )
      return img.astype(np.float32)
  
imports: import math
  import numpy
  import cv2
label_desc: Use image node_id 3 for calling a global function with example usage: scale(size, image) and returns: img, image