code: def get_rotate(create_labels=None):
      """Returns a function that does 90deg rotations and sets according labels.
  
      Args:
        create_labels: create new labels to the default label field in the input
          dictionary. It should be set to one of ['rotation', 'supervised', None].
  
      Returns:
        A function, that applies rotation preprocess.
      """
  
      def _four_rots(img):
          """Rotates an image four times, with 90 degrees between each rotation."""
          return tf.stack(
              [
                  img,
                  tf.transpose(tf.reverse_v2(img, [1]), [1, 0, 2]),
                  tf.reverse_v2(img, [0, 1]),
                  tf.reverse_v2(tf.transpose(img, [1, 0, 2]), [1]),
              ]
          )
  
      def _rotate_pp(data):
          """Rotate preprocessing function applied on data dictionary input."""
          assert create_labels in [
              "rotation",
              "supervised",
              None,
          ], "create_labels:{} must be one of ['rotation', 'supervised', None].".format(
              create_labels
          )
  
          # Creates labels in the same structure as images.
          if create_labels == "rotation":
              data["label"] = tf.constant([0, 1, 2, 3])
          # Duplicates the original supervised label four times.
          elif create_labels == "supervised":
              if "label" in data:
                  data["label"] = tf.stack(
                      tf.tile([data["label"]], [4])
                  )
          # Creates rotated images and rot labels.
          data["image"] = _four_rots(data["image"])
          data["rot_label"] = tf.constant([0, 1, 2, 3])
  
          return data
  
      return _rotate_pp
  
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 22 for calling a global function with example usage: get_rotate(create_labels) and returns: _rotate_pp, tf, data