code: def resize(image, desired_size):
      old_size = image.shape[
          :2
      ]  # old_size is in (height, width) format
      ratio = min(np.divide(desired_size, old_size))
      new_size = (int(old_size[0] * ratio), int(old_size[1] * ratio))
  
      # new_size should be in (width, height) format
      if image.shape[2] == 1:
          image = imresize(
              image, (new_size[1], new_size[0]), interpolate="nearest"
          )
          return image
      image = imresize(image, (new_size[1], new_size[0]))
  
      return image
  
imports: import numpy
  from nnabla.utils.image_utils import imresize
label_desc: Use image node_id 1 for calling a global function with example usage: resize(image, desired_size) and returns: image, image