code: def patchify(patch_size: Tuple[int, int], stride: Tuple[int, int]):
      """Patchifies image.
  
      If image is of size (h, w, c), patchify it into (h//p*w//p, p*p*c)
  
      Args:
        patch_size: Integer.
        stride: Integer.
  
      Returns:
        A function that applies RandAugment.
      """
  
      def _extract_patches(image):
          """Extracts image patches."""
          h, w, _ = image.get_shape().as_list()
  
          count_h = h // stride[0]
          count_w = w // stride[1]
  
          # pyformat: disable
          image = tf.extract_image_patches(
              image[None],
              [1, patch_size[0], patch_size[1], 1],
              [1, stride[0], stride[1], 1],
              [1, 1, 1, 1],
              padding="VALID",
          )
          # pyformat: enable
          return tf.reshape(image, [count_h * count_w, -1])
  
      return _extract_patches
  
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 35 for calling a global function with example usage: patchify(patch_size, stride) and returns: _extract_patches, tf