code: def test_corrupted_groups(group_param):
      batch = [
          _data(0),
          _data(1),
          _data(2),
          _data(3, shape=(3, 10, 10, 6)),
      ]
      groups = [[0], [2, 3]]
  
      if group_param == "default":
          base_gen = DummyGenerator(groups, batch_dims=1, data=[batch])
          corr_gen = CorruptedGenerator(base_gen)
      else:
          base_gen = DummyGenerator(None, batch_dims=1, data=[batch])
          corr_gen = CorruptedGenerator(
              base_gen, corrupt_index_groups=groups
          )
  
      corr_seq = corr_gen.flow()
      assert len(corr_seq) == 1
  
      (corr0, corr2, corr3, *orig), targets = corr_seq[0]
      assert len(orig) == len(batch)
      for o, b in zip(orig, batch):
          np.testing.assert_array_equal(o, b)
  
      np.testing.assert_array_equal(
          _sorted_feats([corr0]), _sorted_feats([orig[0]])
      )
      np.testing.assert_array_equal(
          _sorted_feats([corr2, corr3]),
          _sorted_feats([orig[2], orig[3]]),
      )
      # check that the corruption move some things between the groups (this is exceedingly likely to
      # happen, with this size of data)
      assert np.any(_sorted_feats([corr2]) != _sorted_feats([orig[2]]))
      assert np.any(_sorted_feats([corr3]) != _sorted_feats([orig[3]]))
  
      np.testing.assert_array_equal(targets, [[1, 0], [1, 0], [1, 0]])
  
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 7 for calling a global function with example usage: test_corrupted_groups(group_param) without return types