code: def _validate_indices(corrupt_index_groups):
      # specific type check because the iteration order needs to be controlled/consistent
      if not isinstance(corrupt_index_groups, (list, tuple)):
          raise TypeError(
              f"corrupt_index_groups: expected list or tuple, found {type(corrupt_index_groups).__name__}"
          )
  
      all_seen = {}
      for group_idx, group in enumerate(corrupt_index_groups):
          if not isinstance(group, (list, tuple)):
              raise TypeError(
                  f"corrupt_index_groups: expected each group to be a list or tuple, found {type(group).__name__} for group number {group_idx}"
              )
  
          if len(group) == 0:
              raise ValueError(
                  f"corrupt_index_groups: expected each group to have at least one index, found empty group number {group_idx}"
              )
  
          for elem in group:
              earlier_idx = all_seen.get(elem)
              if earlier_idx is not None:
                  raise ValueError(
                      f"corrupt_index_groups: expected each index to appear at most once, found two occurrences of {elem} (in group numbers {earlier_idx} and {group_idx})"
                  )
  
              all_seen[elem] = group_idx
              if not isinstance(elem, int) or elem < 0:
                  raise TypeError(
                      f"corrupt_index_groups: expected each index to be a non-negative integer, found {type(elem).__name__} ({elem!r}) in group number {group_idx}"
                  )
  
file_path: stellargraph/stellargraph/mapper/corrupted.py
imports: import numpy
  from tensorflow.keras.utils import Sequence
  from .None import Generator
  from ..core.validation import comma_sep
label_desc: Use image node_id 1 for calling a global function with example usage: _validate_indices(corrupt_index_groups) without return types