code: def test_ClusterNodeSequence_init():
      G = create_stellargraph()
  
      nsg = ClusterNodeSequence(graph=G, clusters=[list(G.nodes())])
      assert len(nsg) == 1
  
      nsg = ClusterNodeSequence(
          graph=G, clusters=[["a"], ["b", "d"], ["c"]]
      )
      assert len(nsg) == 3
  
      # If targets are given, so should node_ids that correspond to these targets
      with pytest.raises(ValueError):
          ClusterNodeSequence(
              graph=G,
              clusters=[list(G.nodes())],
              q=1,
              targets=np.array([[0, 1]]),
          )
  
      # targets and node_id should have the same length.
      with pytest.raises(ValueError):
          ClusterNodeSequence(
              graph=G,
              clusters=[list(G.nodes())],
              q=1,
              targets=np.array([[0, 1], [1, 0]]),
              node_ids=["a"],
          )
  
      # len(clusters) is not exactly divisible by q
      with pytest.raises(ValueError):
          ClusterNodeSequence(graph=G, clusters=[list(G.nodes())], q=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 2 for calling a global function with example usage: test_ClusterNodeSequence_init() without return types