code: def resize(
      image,
      size,
      interpolation="bilinear",
      antialias=False,
      data_format="channels_last",
  ):
      if interpolation not in RESIZE_INTERPOLATIONS:
          raise ValueError(
              "Invalid value for argument `interpolation`. Expected of one "
              f"{RESIZE_INTERPOLATIONS}. Received: interpolation={interpolation}"
          )
      if not len(size) == 2:
          raise ValueError(
              "Argument `size` must be a tuple of two elements "
              f"(height, width). Received: size={size}"
          )
      size = tuple(size)
      if data_format == "channels_first":
          if len(image.shape) == 4:
              image = tf.transpose(image, (0, 2, 3, 1))
          elif len(image.shape) == 3:
              image = tf.transpose(image, (1, 2, 0))
          else:
              raise ValueError(
                  "Invalid input rank: expected rank 3 (single image) "
                  "or rank 4 (batch of images). Received input with shape: "
                  f"image.shape={image.shape}"
              )
  
      resized = tf.image.resize(
          image, size, method=interpolation, antialias=antialias
      )
      if data_format == "channels_first":
          if len(image.shape) == 4:
              resized = tf.transpose(resized, (0, 3, 1, 2))
          elif len(image.shape) == 3:
              resized = tf.transpose(resized, (2, 0, 1))
      return tf.cast(resized, image.dtype)
  
file_path: keras/keras/backend/tensorflow/image.py
imports: import functools
  import itertools
  import operator
  import tensorflow
  from keras.backend.tensorflow.core import convert_to_tensor
label_desc: Use image node_id 1 for calling a global function with example usage: resize(image, size, interpolation, antialias, data_format) and returns: tf