code: def get_resize(
      resize_size,
      method=tf2.image.ResizeMethod.BILINEAR,
      antialias=False,
  ):
      """Resizes image to a given size.
  
      Args:
        resize_size: either an integer H, where H is both the new height and width
          of the resized image, or a list or tuple [H, W] of integers, where H and W
          are new image"s height and width respectively.
        method: The type of interpolation to apply when resizing.
        antialias: Whether to use an anti-aliasing filter when downsampling an
          image.
  
      Returns:
        A function for resizing an image.
  
      """
      resize_size = utils.maybe_repeat(resize_size, 2)
  
      def _resize(image):
          """Resizes image to a given size."""
          # Note: use TF-2 version of tf.image.resize as the version in TF-1 is
          # buggy: https://github.com/tensorflow/tensorflow/issues/6720.
          # In particular it was not equivariant with rotation and lead to the network
          # to learn a shortcut in self-supervised rotation task, if rotation was
          # applied after resize.
          dtype = image.dtype
          image = tf2.image.resize(
              images=image,
              size=resize_size,
              method=method,
              antialias=antialias,
          )
          return tf.cast(image, dtype)
  
      return _resize
  
imports: from typing import Optional, Tuple
  import numpy
  from scenic.dataset_lib.big_transfer.preprocessing import autoaugment
  from scenic.dataset_lib.big_transfer.preprocessing import utils
  from scenic.dataset_lib.big_transfer.registry import Registry
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_addons import image
label_desc: Use image node_id 9 for calling a global function with example usage: get_resize(resize_size, method, antialias) and returns: _resize, tf