code: def resize_image(
      in_image,
      new_width,
      new_height,
      out_image=None,
      resize_mode=Image.ANTIALIAS,
  ):
      """Resize an image.
  
      Arguments:
          in_image: `PIL.Image`. The image to resize.
          new_width: `int`. The image new width.
          new_height: `int`. The image new height.
          out_image: `str`. If specified, save the image to the given path.
          resize_mode: `PIL.Image.mode`. The resizing mode.
  
      Returns:
          `PIL.Image`. The resize image.
  
      """
      img = in_image.resize((new_width, new_height), resize_mode)
      if out_image:
          img.save(out_image)
      return img
  
imports: from __future__ import division, print_function, absolute_import
  import os
  import random
  import numpy
  from PIL import Image
  import pickle
  import csv
  import warnings
  import tensorflow.compat.v1
  from io import BytesIO
label_desc: Use image node_id 12 for calling a global function with example usage: resize_image(in_image, new_width, new_height, out_image, resize_mode) and returns: img