code: def rescale(image, level):
      """Rescales image and enlarged cornet."""
      # TODO: should we do center crop instead?
      # TODO: add support of other resize methods
      # See tf.image.ResizeMethod for full list
      size = image.shape[:2]
      scale = level * 0.25
      scale_height = tf.cast(scale * size[0], tf.int32)
      scale_width = tf.cast(scale * size[1], tf.int32)
      cropped_image = tf.image.crop_to_bounding_box(
          image,
          offset_height=scale_height,
          offset_width=scale_width,
          target_height=size[0] - scale_height,
          target_width=size[1] - scale_width,
      )
      rescaled = tf.image.resize(
          cropped_image, size, tf.image.ResizeMethod.BICUBIC
      )
      return tf.saturate_cast(rescaled, tf.uint8)
  
imports: import math
  import tensorflow
  import tensorflow_addons
label_desc: Use image node_id 25 for calling a global function with example usage: rescale(image, level) and returns: tf