code: def test_kg_triple_generator(knowledge_graph):
      gen = KGTripleGenerator(knowledge_graph, 2)
  
      edges = triple_df(
          ("a", "W", "b"), ("c", "X", "a"), ("d", "Y", "c")
      )
  
      seq = gen.flow(edges)
      check_sequence_output(seq[0], 2, None)
      check_sequence_output(seq[1], 1, None)
  
      seq = gen.flow(edges, negative_samples=10)
      check_sequence_output(
          seq[0], 2, 10, knowledge_graph.number_of_nodes()
      )
  
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 3 for calling a global function with example usage: test_kg_triple_generator(knowledge_graph) without return types