code: def test_hinnodemapper_shuffle():
      random.seed(10)
  
      batch_size = 2
      feature_sizes = {"t1": 1, "t2": 4}
      G, nodes_type_1, nodes_type_2 = example_hin_2(feature_sizes)
  
      mapper = HinSAGENodeGenerator(
          G, batch_size=batch_size, num_samples=[0], head_node_type="t1"
      ).flow(nodes_type_1, nodes_type_1, shuffle=True)
  
      expected_node_batches = [[3, 2], [1, 0]]
      assert len(mapper) == 2
      for ii in range(len(mapper)):
          nf, nl = mapper[ii]
          assert all(np.ravel(nf[0]) == expected_node_batches[ii])
          assert all(np.array(nl) == expected_node_batches[ii])
  
      # This should re-shuffle the IDs
      mapper.on_epoch_end()
      expected_node_batches = [[2, 1], [3, 0]]
      assert len(mapper) == 2
      for ii in range(len(mapper)):
          nf, nl = mapper[ii]
          assert all(np.ravel(nf[0]) == expected_node_batches[ii])
          assert all(np.array(nl) == expected_node_batches[ii])
  
      # With no shuffle
      mapper = HinSAGENodeGenerator(
          G, batch_size=batch_size, num_samples=[0], head_node_type="t1"
      ).flow(nodes_type_1, nodes_type_1, shuffle=False)
      expected_node_batches = [[0, 1], [2, 3]]
      assert len(mapper) == 2
      for ii in range(len(mapper)):
          nf, nl = mapper[ii]
          assert all(np.ravel(nf[0]) == expected_node_batches[ii])
          assert all(np.array(nl) == expected_node_batches[ii])
  
imports: from stellargraph.core.graph import *
  from stellargraph.mapper import *
  import networkx
  import numpy
  import random
  import pytest
  import pandas
  import scipy.sparse
  from ..test_utils.graphs import example_graph, example_graph_random, example_hin_1, create_graph_features, repeated_features, weighted_tree
  from ..None import test_utils
label_desc: Use image node_id 20 for calling a global function with example usage: test_hinnodemapper_shuffle() without return types