code: def test_nodemapper_shuffle(shuffle):
      n_feat = 1
      n_batch = 2
  
      G = example_graph_2(feature_size=n_feat)
      nodes = list(G.nodes())
  
      def flatten_features(seq):
          # check (features == labels) and return flattened features
          batches = [
              (np.ravel(seq[i][0][0]), np.array(seq[i][1]))
              for i in range(len(seq))
          ]
          features, labels = zip(*batches)
          features, labels = np.concatenate(features), np.concatenate(
              labels
          )
          assert all(features == labels)
          return features
  
      def consecutive_epochs(seq):
          features = flatten_features(seq)
          seq.on_epoch_end()
          features_next = flatten_features(seq)
          return features, features_next
  
      seq = GraphSAGENodeGenerator(
          G, batch_size=n_batch, num_samples=[0]
      ).flow(nodes, nodes, shuffle=shuffle)
  
      max_iter = 5
      comparison_results = set()
  
      for i in range(max_iter):
          f1, f2 = consecutive_epochs(seq)
          comparison_results.add(all(f1 == f2))
  
      if not shuffle:
          assert comparison_results == {True}
      else:
          assert False in comparison_results
  
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 8 for calling a global function with example usage: test_nodemapper_shuffle(shuffle) and returns: features, features,  features_next