code: def resize_by_area(img, size):
      """image resize function used by quite a few image problems."""
      return tf.to_int64(
          tf.image.resize_images(
              img, [size, size], tf.image.ResizeMethod.AREA
          )
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import io
  import os
  import numpy
  from tensor2tensor.data_generators import generator_utils
  from tensor2tensor.data_generators import problem
  from tensor2tensor.data_generators import text_encoder
  from tensor2tensor.layers import common_layers
  from tensor2tensor.layers import modalities
  from tensor2tensor.utils import contrib
  from tensor2tensor.utils import metrics
  import tensorflow.compat.v1
label_desc: Use image node_id 4 for calling a global function with example usage: resize_by_area(img, size) and returns: tf