code: def test_kg_triple_sequence_shuffle(shuffle):
      seq = KGTripleSequence(
          max_node_iloc=10,
          source_ilocs=[0, 1, 2, 3, 4],
          rel_ilocs=[0, 1, 0, 1, 0],
          target_ilocs=[4, 3, 2, 1, 0],
          batch_size=5,
          shuffle=shuffle,
          negative_samples=None,
          sample_strategy="uniform",
          seed=None,
      )
      assert len(seq) == 1
  
      def sample():
          ret = seq[0]
          seq.on_epoch_end()
          return ret
  
      # with 20 epochs, it's very unlikely ((1/5!)**20 ≈ 2.6e-42) they will all be the same, if
      # (uniform) shuffling is happening
      first, *rest = [sample() for _ in range(20)]
  
      should_be_equal = not shuffle
      assert (
          all(epoch_sample_equal(first, r) for r in rest)
          == should_be_equal
      )
  
file_path: stellargraph/tests/mapper/test_knowledge_graph.py
imports: import pytest
  import pandas
  import numpy
  from stellargraph.mapper.knowledge_graph import KGTripleGenerator, KGTripleSequence
  from ..None import test_utils
  from ..test_utils.graphs import knowledge_graph
label_desc: Use image node_id 7 for calling a global function with example usage: test_kg_triple_sequence_shuffle(shuffle) and returns: ret