code: def test_extract_patches(
      self, size, strides, dilation_rate, padding, data_format
  ):
      if (
          data_format == "channels_first"
          and backend.backend() == "tensorflow"
      ):
          pytest.skip("channels_first unsupported on CPU with TF")
  
      if (
          isinstance(strides, tuple)
          and backend.backend() == "tensorflow"
          and dilation_rate > 1
      ):
          pytest.skip(
              "dilation_rate>1 with strides>1 not supported with TF"
          )
      if data_format == "channels_first":
          image = np.random.uniform(size=(1, 3, 20, 20))
      else:
          image = np.random.uniform(size=(1, 20, 20, 3))
      patch_h, patch_w = size[0], size[1]
      if strides is None:
          strides_h, strides_w = patch_h, patch_w
      else:
          strides_h, strides_w = strides[0], strides[1]
  
      patches_out = kimage.extract_patches(
          backend.convert_to_tensor(image, dtype="float32"),
          size=size,
          strides=strides,
          dilation_rate=dilation_rate,
          padding=padding,
          data_format=data_format,
      )
      if data_format == "channels_first":
          patches_out = backend.numpy.transpose(
              patches_out, axes=[0, 2, 3, 1]
          )
      if data_format == "channels_first":
          image = np.transpose(image, [0, 2, 3, 1])
      patches_ref = tf.image.extract_patches(
          image,
          sizes=(1, patch_h, patch_w, 1),
          strides=(1, strides_h, strides_w, 1),
          rates=(1, dilation_rate, dilation_rate, 1),
          padding=padding.upper(),
      )
      self.assertEqual(
          tuple(patches_out.shape), tuple(patches_ref.shape)
      )
      self.assertAllClose(
          patches_ref.numpy(),
          backend.convert_to_numpy(patches_out),
          atol=0.3,
      )
  
imports: import math
  import numpy
  import pytest
  import scipy.ndimage
  import tensorflow
  from absl.testing import parameterized
  from keras import backend
  from keras import testing
  from keras.backend.common.keras_tensor import KerasTensor
  from keras.ops import image
label_desc: Use image node_id 3 for calling the ImageOpsCorrectnessTest obj's underlying member method code with example usage: obj.test_extract_patches(size, strides, dilation_rate, padding, data_format) without return types