code: def test_generator_pairs(use_targets, use_ilocs):
      generator = PaddedGraphGenerator(graphs=graphs)
  
      targets = [12, 34, 56] if use_targets else None
      ilocs = [(1, 0), (0, 2), (2, 1)]
      input = (
          ilocs
          if use_ilocs
          else [[graphs[x] for x in pair] for pair in ilocs]
      )
  
      seq = generator.flow(input, targets=targets, batch_size=2)
  
      assert len(seq) == 2
  
      values_0, targets_0 = seq[0]
      assert len(values_0) == 6
      assert values_0[0].shape == (2, 6, 4)
      assert values_0[3].shape == (2, 6, 4)
      np.testing.assert_array_equal(
          values_0[1], [_mask(5, 6), _mask(6, 6)]
      )
      np.testing.assert_array_equal(
          values_0[4], [_mask(6, 6), _mask(3, 6)]
      )
      assert values_0[2].shape == (2, 6, 6)
      assert values_0[5].shape == (2, 6, 6)
      if use_targets:
          np.testing.assert_array_equal(targets_0, [12, 34])
      else:
          assert targets_0 is None
  
      values_1, targets_1 = seq[1]
      assert len(values_1) == 6
      assert values_1[0].shape == (1, 5, 4)
      assert values_1[3].shape == (1, 5, 4)
      np.testing.assert_array_equal(values_1[1], [_mask(3, 5)])
      np.testing.assert_array_equal(values_1[4], [_mask(5, 5)])
      assert values_1[2].shape == (1, 5, 5)
      assert values_1[5].shape == (1, 5, 5)
      if use_targets:
          np.testing.assert_array_equal(targets_1, [56])
      else:
          assert targets_1 is None
  
imports: from stellargraph.core.graph import *
  from stellargraph.mapper.padded_graph_generator import PaddedGraphGenerator, PaddedGraphSequence
  import numpy
  import pytest
  from ..test_utils.graphs import example_graph_random, example_graph, example_hin_1
label_desc: Use image node_id 16 for calling a global function with example usage: test_generator_pairs(use_targets, use_ilocs) without return types