code: def resize(img, small_size):
      """Resize the image to make the smaller side be at the given size"""
      size = img.size
      if size[0] < size[1]:
          new_size = (small_size, int(small_size * size[1] / size[0]))
      else:
          new_size = (int(small_size * size[0] / size[1]), small_size)
      new_img = img.resize(new_size, Image.BILINEAR)
      # print 'resize to (%d,%d)' % new_size
      return new_img
  
imports: from __future__ import division
  from builtins import range
  from builtins import object
  import random
  import numpy
  from PIL import Image, ImageEnhance
  import math
label_desc: Use image node_id 4 for calling a global function with example usage: resize(img, small_size) and returns: new_img