code: def test_sampling_rate(self):
      data = np.arange(100)
      targets = data * 2
      dataset = timeseries_dataset_utils.timeseries_dataset_from_array(
          data,
          targets,
          sequence_length=9,
          batch_size=5,
          sampling_rate=2,
      )
      for i, batch in enumerate(dataset):
          self.assertLen(batch, 2)
          inputs, targets = batch
          if i < 16:
              self.assertEqual(inputs.shape, (5, 9))
          if i == 16:
              # Last batch: size 4
              self.assertEqual(inputs.shape, (4, 9))
          # Check target values
          self.assertAllClose(inputs[:, 0] * 2, targets)
          for j in range(min(5, len(inputs))):
              # Check each sample in the batch
              start_index = i * 5 + j
              end_index = start_index + 9 * 2
              self.assertAllClose(
                  inputs[j], np.arange(start_index, end_index, 2)
              )
  
file_path: keras/keras/utils/timeseries_dataset_utils_test.py
imports: import numpy
  from keras import testing
  from keras.utils import timeseries_dataset_utils
label_desc: Use image node_id 5 for calling the TimeseriesDatasetTest obj's underlying member method code with example usage: obj.test_sampling_rate() without return types