code: def letterbox_image(image, size):
      iw, ih = image.size
      w, h = size
      scale = min(w / iw, h / ih)
      nw = int(iw * scale)
      nh = int(ih * scale)
  
      image = image.resize((nw, nh), Image.BICUBIC)
      new_image = Image.new("RGB", size, (128, 128, 128))
      new_image.paste(image, ((w - nw) // 2, (h - nh) // 2))
      return new_image
  
imports: import tensorflow
  from keras import backend
  import numpy
  from PIL import Image
  import cv2
label_desc: Use image node_id 5 for calling a global function with example usage: letterbox_image(image, size) and returns: new_image