code: def resize(
      im: np.ndarray,
      target_size: Union[List[int], int],
      interpolation: int = cv2.INTER_LINEAR,
  ) -> np.ndarray:
      """
      Resize the input image.
  
      Args:
          im(np.ndarray): Input image.
          target_size(int|list[int]): The target size, if the input type is int, the target width and height will be set
                                      to this value, if the input type is list, the first element in the list represents
                                      the target width, and the second value represents the target height.
          interpolation(int): Interpolation method. Default to cv2.INTER_LINEAR.
      """
      if isinstance(target_size, list) or isinstance(
          target_size, tuple
      ):
          w = target_size[0]
          h = target_size[1]
      else:
          w = target_size
          h = target_size
      im = cv2.resize(im, (w, h), interpolation=interpolation)
      return im
  
file_path: PaddleHub/paddlehub/vision/functional.py
imports: import os
  from typing import List, Union
  import cv2
  import PIL
  import numpy
label_desc: Use image node_id 3 for calling a global function with example usage: resize(im, target_size, interpolation) and returns: im