code: def test_corrupted_batching(batch_dims):
      batch0_shape = (10, 4, 5, 6)
      batch0 = [_data(0, shape=batch0_shape)]
      # different batch sizes
      batch1_shape = (5, 4, 5, 6)
      batch1 = [_data(1, shape=batch1_shape)]
  
      base_gen = DummyGenerator(
          [[0]], batch_dims=batch_dims, data=[batch0, batch1]
      )
      corr_gen = CorruptedGenerator(base_gen)
  
      corr_seq = corr_gen.flow()
      assert len(corr_seq) == 2
  
      def check(index, shape):
          (corr, orig), targets = corr_seq[index]
  
          assert targets.shape == (*shape[:batch_dims], 2)
          np.testing.assert_array_equal(targets[..., 0], 1)
          np.testing.assert_array_equal(targets[..., 1], 0)
  
      check(0, batch0_shape)
      check(1, batch1_shape)
  
file_path: stellargraph/tests/mapper/test_corrupted.py
imports: import pytest
  import numpy
  from stellargraph.mapper import *
  from ..test_utils.graphs import example_graph_random
label_desc: Use image node_id 8 for calling a global function with example usage: test_corrupted_batching(batch_dims) without return types