code: def test_ClusterNodeGenerator_init():
      G = create_stellargraph()
  
      with pytest.raises(ValueError):
          generator = ClusterNodeGenerator(G, clusters=0)
  
      # clusters must be integer if not list
      with pytest.raises(TypeError):
          generator = ClusterNodeGenerator(G, clusters=0.5)
  
      # q must be greater than 0
      with pytest.raises(ValueError):
          generator = ClusterNodeGenerator(G, q=0)
  
      # q must be integer
      with pytest.raises(TypeError):
          generator = ClusterNodeGenerator(G, q=1.0)
  
      # number of clusters is not exactly divisible by q
      with pytest.raises(ValueError):
          generator = ClusterNodeGenerator(G, clusters=5, q=2)
  
      # one cluster, k=len(clusters), not divisible by q
      with pytest.raises(ValueError):
          generator = ClusterNodeGenerator(
              G, clusters=[["a", "b", "c", "d"]], q=2
          )
  
      # this should be ok
      generator = ClusterNodeGenerator(
          G, clusters=[["a", "b", "c", "d"]], q=1
      )
      assert generator.k == 1
      assert generator.q == 1
  
      # two clusters, len(clusters).
      generator = ClusterNodeGenerator(
          G, clusters=[["a", "d"], ["b", "c"]], q=1
      )
      assert generator.k == 2
      assert generator.q == 1
  
      # lam has to be in the interval [0., 1.] and float
      with pytest.raises(TypeError):
          generator = ClusterNodeGenerator(G, clusters=1, q=1, lam=-1)
  
      with pytest.raises(TypeError):
          generator = ClusterNodeGenerator(G, clusters=1, q=1, lam=1)
  
      with pytest.raises(ValueError):
          generator = ClusterNodeGenerator(G, clusters=1, q=1, lam=2.5)
  
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 4 for calling a global function with example usage: test_ClusterNodeGenerator_init() without return types