code: def test_tf_data_compatibility(self):
      if backend.config.image_data_format() == "channels_last":
          input_shape = (1, 5, 5, 1)
      else:
          input_shape = (1, 1, 5, 5)
      input_image = np.reshape(np.arange(0, 25), input_shape)
      layer = layers.RandomRotation(factor=(0.5, 0.5))
  
      ds = tf_data.Dataset.from_tensor_slices(input_image).map(layer)
      expected_output = np.asarray(
          [
              [24, 23, 22, 21, 20],
              [19, 18, 17, 16, 15],
              [14, 13, 12, 11, 10],
              [9, 8, 7, 6, 5],
              [4, 3, 2, 1, 0],
          ]
      ).reshape(input_shape[1:])
      for output in ds.take(1):
          output = output.numpy()
      self.assertAllClose(expected_output, output)
  
file_path: keras/keras/layers/preprocessing/random_rotation_test.py
imports: import numpy
  from absl.testing import parameterized
  from tensorflow import data
  from keras import backend
  from keras import layers
  from keras import testing
label_desc: Use image node_id 4 for calling the RandomRotationTest obj's underlying member method code with example usage: obj.test_tf_data_compatibility() without return types