code: def test_cluster_weighted():
      G = create_stellargraph()
  
      unweighted = ClusterNodeGenerator(
          G, clusters=1, q=1, weighted=False
      ).flow(node_ids=["a", "b", "c", "d"])
      weighted = ClusterNodeGenerator(
          G, clusters=1, q=1, weighted=True
      ).flow(node_ids=["a", "b", "c", "d"])
  
      assert len(unweighted) == len(weighted) == 1
      unweighted_features, _ = unweighted[0]
      weighted_features, _ = weighted[0]
  
      def canonical(adj):
          return np.sort(adj.ravel())
  
      assert not np.allclose(
          canonical(weighted_features[2]),
          canonical(unweighted_features[2]),
      )
  
file_path: stellargraph/tests/mapper/test_cluster_gcn_node_mapper.py
imports: from stellargraph.mapper import ClusterNodeGenerator, ClusterNodeSequence
  from stellargraph.core.graph import StellarGraph
  import pandas
  import numpy
  import pytest
  from ..test_utils.graphs import example_graph_random
label_desc: Use image node_id 6 for calling a global function with example usage: test_cluster_weighted() and returns: np