code: def extract_patches(
      image,
      size,
      strides=None,
      dilation_rate=1,
      padding="valid",
      data_format="channels_last",
  ):
      """Extracts patches from the image(s).
  
      Args:
          image: Input image or batch of images. Must be 3D or 4D.
          size: Patch size int or tuple (patch_height, patch_widht)
          strides: strides along height and width. If not specified, or
              if `None`, it defaults to the same value as `size`.
          dilation_rate: This is the input stride, specifying how far two
              consecutive patch samples are in the input. For value other than 1,
              strides must be 1. NOTE: `strides > 1` is not supported in
              conjunction with `dilation_rate > 1`
          padding: The type of padding algorithm to use: `"same"` or `"valid"`.
          data_format: string, either `"channels_last"` or `"channels_first"`.
              The ordering of the dimensions in the inputs. `"channels_last"`
              corresponds to inputs with shape `(batch, height, width, channels)`
              while `"channels_first"` corresponds to inputs with shape
              `(batch, channels, height, weight)`. It defaults to the
              `image_data_format` value found in your Keras config file at
              `~/.keras/keras.json`. If you never set it, then it will be
              `"channels_last"`.
  
      Returns:
          Extracted patches 3D (if not batched) or 4D (if batched)
  
      Examples:
  
      >>> image = np.random.random(
      ...     (2, 20, 20, 3)
      ... ).astype("float32") # batch of 2 RGB images
      >>> patches = keras.ops.image.extract_patches(image, (5, 5))
      >>> patches.shape
      (2, 4, 4, 75)
      >>> image = np.random.random((20, 20, 3)).astype("float32") # 1 RGB image
      >>> patches = keras.ops.image.extract_patches(image, (3, 3), (1, 1))
      >>> patches.shape
      (18, 18, 27)
      """
      if any_symbolic_tensors((image,)):
          return ExtractPatches(
              size=size,
              strides=strides,
              dilation_rate=dilation_rate,
              padding=padding,
              data_format=data_format,
          ).symbolic_call(image)
  
      return _extract_patches(
          image,
          size,
          strides,
          dilation_rate,
          padding,
          data_format=data_format,
      )
  
imports: from keras import backend
  from keras import ops
  from keras.api_export import keras_export
  from keras.backend import KerasTensor
  from keras.backend import any_symbolic_tensors
  from keras.ops.operation import Operation
  from keras.ops.operation_utils import compute_conv_output_shape
label_desc: Use image node_id 3 for calling a global function with example usage: extract_patches(image, size, strides, dilation_rate, padding, data_format) and returns: _extract_patches, ExtractPatches