code: def get_random_rotation(min_angle=0, max_angle=360):
      """Randomly rotate an image."""
      if min_angle > max_angle:
          raise ValueError(
              "min_angle (%f) must be lower than max_angle (%f)"
              % (min_angle, max_angle)
          )
      # Convert to radians.
      min_angle = np.radians(min_angle)
      max_angle = np.radians(max_angle)
  
      def _random_rotation(image):
          """Rotation function."""
          num_dims = len(image.shape)
          if num_dims in [3, 4]:
              batch_size = tf.shape(image)[0] if num_dims == 4 else 1
          else:
              raise ValueError(
                  'Tensor "image" should have 3 or 4 dimensions.'
              )
          random_angles = tf.random.uniform(
              shape=(batch_size,), minval=min_angle, maxval=max_angle
          )
          return image_utils.rotate(images=image, angles=random_angles)
  
      return _random_rotation
  
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 20 for calling a global function with example usage: get_random_rotation(min_angle, max_angle) and returns: _random_rotation, image_utils