class_docstr: A data generator for use with GCN, GAT and APPNP models on homogeneous graphs, see [1].
  
  The supplied graph G should be a StellarGraph object with node features.
  Use the :meth:`flow` method supplying the nodes and (optionally) targets
  to get an object that can be used as a Keras data generator.
  
  This generator will supply the features array and the adjacency matrix to a
  mini-batch Keras graph ML model.
  
  [1] `W. Chiang, X. Liu, S. Si, Y. Li, S. Bengio, C. Hsieh, 2019 <https://arxiv.org/abs/1905.07953>`_.
  
  .. seealso::
  
     Models using this generator: :class:`.GCN`, :class:`.GAT`, :class:`.APPNP`.
  
     Examples using this generator:
  
     - `Cluster-GCN node classification <https://stellargraph.readthedocs.io/en/stable/demos/node-classification/cluster-gcn-node-classification.html>`__
     - `Cluster-GCN node classification with Neo4j <https://stellargraph.readthedocs.io/en/stable/demos/connector/neo4j/cluster-gcn-on-cora-neo4j-example.html>`__
     - `unsupervised representation learning with Deep Graph Infomax <https://stellargraph.readthedocs.io/en/stable/demos/embeddings/deep-graph-infomax-embeddings.html>`__
  
  Args:
      G (StellarGraph): a machine-learning StellarGraph-type graph
      clusters (int or list, optional): If int, it indicates the number of clusters (default is 1, corresponding to the entire graph).
          If `clusters` is greater than 1, then nodes are randomly assigned to a cluster.
          If list, then it should be a list of lists of node IDs, such that each list corresponds to a cluster of nodes
          in `G`. The clusters should be non-overlapping.
      q (int, optional): The number of clusters to combine for each mini-batch (default is 1).
          The total number of clusters must be divisible by `q`.
      lam (float, optional): The mixture coefficient for adjacency matrix normalisation (default is 0.1).
          Valid values are in the interval [0, 1].
      weighted (bool, optional): if True, use the edge weights from ``G``; if False, treat the
          graph as unweighted.
      name (str, optional): Name for the node generator.
class_docstr_tok: ["A","data","generator","for","use","with","GCN",",","GAT","and","APPNP","models","on","homogeneous","graphs",",","see","[","1","]",".","The","supplied","graph","G","should","be","a","StellarGraph","object","with","node","features",".","Use","the",":","meth",":","`","flow","`","method","supplying","the","nodes","and","(","optionally",")","targets","to","get","an","object","that","can","be","used","as","a","Keras","data","generator",".","This","generator","will","supply","the","features","array","and","the","adjacency","matrix","to","a","mini-batch","Keras","graph","ML","model",".","[","1","]","`","W.","Chiang",",","X.","Liu",",","S.","Si",",","Y.","Li",",","S.","Bengio",",","C.","Hsieh",",","2019","<","https",":","\/\/arxiv.org\/abs\/1905.07953",">","`","_",".","..","seealso",":",":","Models","using","this","generator",":",":","class",":","`",".GCN","`",",",":","class",":","`",".GAT","`",",",":","class",":","`",".APPNP","`",".","Examples","using","this","generator",":","-","`","Cluster-GCN","node","classification","<","https",":","\/\/stellargraph.readthedocs.io\/en\/stable\/demos\/node-classification\/cluster-gcn-node-classification.html",">","`","__","-","`","Cluster-GCN","node","classification","with","Neo4j","<","https",":","\/\/stellargraph.readthedocs.io\/en\/stable\/demos\/connector\/neo4j\/cluster-gcn-on-cora-neo4j-example.html",">","`","__","-","`","unsupervised","representation","learning","with","Deep","Graph","Infomax","<","https",":","\/\/stellargraph.readthedocs.io\/en\/stable\/demos\/embeddings\/deep-graph-infomax-embeddings.html",">","`","__","Args",":","G","(","StellarGraph",")",":","a","machine-learning","StellarGraph-type","graph","clusters","(","int","or","list",",","optional",")",":","If","int",",","it","indicates","the","number","of","clusters","(","default","is","1",",","corresponding","to","the","entire","graph",")",".","If","`","clusters","`","is","greater","than","1",",","then","nodes","are","randomly","assigned","to","a","cluster",".","If","list",",","then","it","should","be","a","list","of","lists","of","node","IDs",",","such","that","each","list","corresponds","to","a","cluster","of","nodes","in","`","G","`",".","The","clusters","should","be","non-overlapping",".","q","(","int",",","optional",")",":","The","number","of","clusters","to","combine","for","each","mini-batch","(","default","is","1",")",".","The","total","number","of","clusters","must","be","divisible","by","`","q","`",".","lam","(","float",",","optional",")",":","The","mixture","coefficient","for","adjacency","matrix","normalisation","(","default","is","0.1",")",".","Valid","values","are","in","the","interval","[","0",",","1","]",".","weighted","(","bool",",","optional",")",":","if","True",",","use","the","edge","weights","from","``","G","``",";","if","False",",","treat","the","graph","as","unweighted",".","name","(","str",",","optional",")",":","Name","for","the","node","generator","."]
code: def num_batch_dims(self):
      return 2
  
imports: import random
  import copy
  import numpy
  import networkx
  from tensorflow.keras.utils import Sequence
  from scipy import sparse
  from ..core.graph import StellarGraph
  from ..core.utils import is_real_iterable, normalize_adj
  from ..connector.neo4j.graph import Neo4jStellarGraph
  from .base import Generator
label_desc: Use image node_id 2 for calling the ClusterNodeGenerator obj's underlying member method code with example usage: obj.num_batch_dims() and returns: int