code: def test_square_pad_tensorflow(
      height,
      width,
      channels_first,
      label_type,
      pad_mode,
      image_batch,
      art_warning,
  ):
      import tensorflow as tf
  
      x, y = image_batch
      length = max(height, width)
  
      x = tf.convert_to_tensor(x)
      if label_type == "classification":
          y = tf.convert_to_tensor(y)
      elif label_type == "object_detection":
          y = [
              {k: tf.convert_to_tensor(v) for k, v in y_i.items()}
              for y_i in y
          ]
  
      try:
          resize = ImageSquarePadTensorFlowV2(
              channels_first=channels_first,
              label_type=label_type,
              pad_mode=pad_mode,
          )
  
          x_preprocess, y_preprocess = resize.forward(x, y)
  
          if channels_first:
              assert x_preprocess.shape == (
                  x.shape[0],
                  x.shape[1],
                  length,
                  length,
              )
          else:
              assert x_preprocess.shape == (
                  x.shape[0],
                  length,
                  length,
                  x.shape[3],
              )
  
          if label_type == "classification":
              np.testing.assert_array_equal(y, y_preprocess)
          elif label_type == "object_detection":
              assert (
                  y[0]["boxes"].shape == y_preprocess[0]["boxes"].shape
              )
              np.testing.assert_array_equal(
                  y[0]["labels"], y_preprocess[0]["labels"]
              )
          else:
              assert y is None
  
      except ARTTestException as e:
          art_warning(e)
  
file_path: adversarial-robustness-toolbox/tests/preprocessing/image/test_image_square_pad.py
imports: import logging
  import numpy
  import pytest
  from art.config import ART_NUMPY_DTYPE
  from art.preprocessing.image import ImageSquarePad, ImageSquarePadPyTorch, ImageSquarePadTensorFlowV2
  from tests.utils import ARTTestException
label_desc: Use image node_id 4 for calling a global function with example usage: test_square_pad_tensorflow(height, width, channels_first, label_type, pad_mode, image_batch, art_warning) without return types