code: def preprocess(image):
      if isinstance(image, np.ndarray):
          image = Image.fromarray(image)
      w, h = image.size
      w, h = map(
          lambda x: x - x % 32, (w, h)
      )  # resize to integer multiple of 32
      image = image.resize((w, h), resample=PIL.Image.LANCZOS)
      image = np.array(image).astype(np.float32) / 255.0
      image = image[None].transpose(0, 3, 1, 2)
      image = paddle.to_tensor(image)
      return 2.0 * image - 1.0
  
imports: import numpy
  import paddle
  import PIL
  from PIL import Image
label_desc: Use image node_id 1 for calling a global function with example usage: preprocess(image) and returns: unknown