class_docstr: A data generator for use with graph classification algorithms.
  
  The supplied graphs should be :class:`.StellarGraph` objects with node features.
  Use the :meth:`flow` method supplying the graph indexes and (optionally) targets
  to get an object that can be used as a Keras data generator.
  
  This generator supplies the features arrays and the adjacency matrices to a mini-batch Keras
  graph classification model. Differences in the number of nodes are resolved by padding each
  batch of features and adjacency matrices, and supplying a boolean mask indicating which are
  valid and which are padding.
  
  .. seealso::
  
     Models using this generator: :class:`.GCNSupervisedGraphClassification`, :class:`.DeepGraphCNN`.
  
     Examples using this generator:
  
     - `graph classification with GCN <https://stellargraph.readthedocs.io/en/stable/demos/graph-classification/gcn-supervised-graph-classification.html>`__
     - `graph classification with Deep Graph CNN <https://stellargraph.readthedocs.io/en/stable/demos/graph-classification/dgcnn-graph-classification.html>`__
     - `unsupervised graph representation learning <https://stellargraph.readthedocs.io/en/stable/demos/embeddings/gcn-unsupervised-graph-embeddings.html>`__
  
  Args:
      graphs (list): a collection of StellarGraph objects
      name (str): an optional name of the generator
class_docstr_tok: ["A","data","generator","for","use","with","graph","classification","algorithms",".","The","supplied","graphs","should","be",":","class",":","`",".StellarGraph","`","objects","with","node","features",".","Use","the",":","meth",":","`","flow","`","method","supplying","the","graph","indexes","and","(","optionally",")","targets","to","get","an","object","that","can","be","used","as","a","Keras","data","generator",".","This","generator","supplies","the","features","arrays","and","the","adjacency","matrices","to","a","mini-batch","Keras","graph","classification","model",".","Differences","in","the","number","of","nodes","are","resolved","by","padding","each","batch","of","features","and","adjacency","matrices",",","and","supplying","a","boolean","mask","indicating","which","are","valid","and","which","are","padding",".","..","seealso",":",":","Models","using","this","generator",":",":","class",":","`",".GCNSupervisedGraphClassification","`",",",":","class",":","`",".DeepGraphCNN","`",".","Examples","using","this","generator",":","-","`","graph","classification","with","GCN","<","https",":","\/\/stellargraph.readthedocs.io\/en\/stable\/demos\/graph-classification\/gcn-supervised-graph-classification.html",">","`","__","-","`","graph","classification","with","Deep","Graph","CNN","<","https",":","\/\/stellargraph.readthedocs.io\/en\/stable\/demos\/graph-classification\/dgcnn-graph-classification.html",">","`","__","-","`","unsupervised","graph","representation","learning","<","https",":","\/\/stellargraph.readthedocs.io\/en\/stable\/demos\/embeddings\/gcn-unsupervised-graph-embeddings.html",">","`","__","Args",":","graphs","(","list",")",":","a","collection","of","StellarGraph","objects","name","(","str",")",":","an","optional","name","of","the","generator"]
docstr: Creates a generator/sequence object for training, evaluation, or prediction
  with the supplied graph indexes and targets.
  
  Args:
      graphs (iterable): an iterable of graph indexes in self.graphs or an iterable of :class:`.StellarGraph` objects
          for the graphs of interest (e.g., training, validation, or test set nodes).
      targets (2d array, optional): a 2D array of numeric graph targets with shape ``(len(graphs),
          len(targets))``.
      symmetric_normalization (bool, optional): The type of normalization to be applied on the graph adjacency
          matrices. If True, the adjacency matrix is left and right multiplied by the inverse square root of the
          degree matrix; otherwise, the adjacency matrix is only left multiplied by the inverse of the degree
          matrix.
      weighted (bool, optional): if True, use the edge weights from ``G``; if False, treat the
          graph as unweighted.
      batch_size (int, optional): The batch size.
      name (str, optional): An optional name for the returned generator object.
      shuffle (bool, optional): If True the node IDs will be shuffled at the end of each epoch.
      seed (int, optional): Random seed to use in the sequence object.
  
  Returns:
      A :class:`.PaddedGraphSequence` object to use with Keras methods :meth:`fit`, :meth:`evaluate`, and :meth:`predict`
docstr_tok: ["Creates","a","generator\/sequence","object","for","training",",","evaluation",",","or","prediction","with","the","supplied","graph","indexes","and","targets",".","Args",":","graphs","(","iterable",")",":","an","iterable","of","graph","indexes","in","self.graphs","or","an","iterable","of",":","class",":","`",".StellarGraph","`","objects","for","the","graphs","of","interest","(","e.g.",",","training",",","validation",",","or","test","set","nodes",")",".","targets","(","2d","array",",","optional",")",":","a","2D","array","of","numeric","graph","targets","with","shape","``","(","len","(","graphs",")",",","len","(","targets",")",")","``",".","symmetric_normalization","(","bool",",","optional",")",":","The","type","of","normalization","to","be","applied","on","the","graph","adjacency","matrices",".","If","True",",","the","adjacency","matrix","is","left","and","right","multiplied","by","the","inverse","square","root","of","the","degree","matrix",";","otherwise",",","the","adjacency","matrix","is","only","left","multiplied","by","the","inverse","of","the","degree","matrix",".","weighted","(","bool",",","optional",")",":","if","True",",","use","the","edge","weights","from","``","G","``",";","if","False",",","treat","the","graph","as","unweighted",".","batch_size","(","int",",","optional",")",":","The","batch","size",".","name","(","str",",","optional",")",":","An","optional","name","for","the","returned","generator","object",".","shuffle","(","bool",",","optional",")",":","If","True","the","node","IDs","will","be","shuffled","at","the","end","of","each","epoch",".","seed","(","int",",","optional",")",":","Random","seed","to","use","in","the","sequence","object",".","Returns",":","A",":","class",":","`",".PaddedGraphSequence","`","object","to","use","with","Keras","methods",":","meth",":","`","fit","`",",",":","meth",":","`","evaluate","`",",","and",":","meth",":","`","predict","`"]
code: def flow(
      self,
      graphs,
      targets=None,
      symmetric_normalization=True,
      weighted=False,
      batch_size=1,
      name=None,
      shuffle=False,
      seed=None,
  ):
      """
      Creates a generator/sequence object for training, evaluation, or prediction
      with the supplied graph indexes and targets.
  
      Args:
          graphs (iterable): an iterable of graph indexes in self.graphs or an iterable of :class:`.StellarGraph` objects
              for the graphs of interest (e.g., training, validation, or test set nodes).
          targets (2d array, optional): a 2D array of numeric graph targets with shape ``(len(graphs),
              len(targets))``.
          symmetric_normalization (bool, optional): The type of normalization to be applied on the graph adjacency
              matrices. If True, the adjacency matrix is left and right multiplied by the inverse square root of the
              degree matrix; otherwise, the adjacency matrix is only left multiplied by the inverse of the degree
              matrix.
          weighted (bool, optional): if True, use the edge weights from ``G``; if False, treat the
              graph as unweighted.
          batch_size (int, optional): The batch size.
          name (str, optional): An optional name for the returned generator object.
          shuffle (bool, optional): If True the node IDs will be shuffled at the end of each epoch.
          seed (int, optional): Random seed to use in the sequence object.
  
      Returns:
          A :class:`.PaddedGraphSequence` object to use with Keras methods :meth:`fit`, :meth:`evaluate`, and :meth:`predict`
  
      """
      if targets is not None:
          # Check targets is an iterable
          if not is_real_iterable(targets):
              raise TypeError(
                  f"targets: expected an iterable or None object, found {type(targets).__name__}"
              )
  
          # Check targets correct shape
          if len(targets) != len(graphs):
              raise ValueError(
                  f"expected targets to be the same length as node_ids, found {len(targets)} vs {len(graphs)}"
              )
  
      if not isinstance(batch_size, int):
          raise TypeError(
              f"expected batch_size to be integer type, found {type(batch_size).__name__}"
          )
  
      if batch_size <= 0:
          raise ValueError(
              f"expected batch_size to be strictly positive integer, found {batch_size}"
          )
  
      graphs_array = np.asarray(graphs)
  
      if len(graphs_array.shape) == 1:
          graphs_array = graphs_array[:, None]
      elif len(graphs_array.shape) != 2:
          raise ValueError(
              f"graphs: expected a shape of length 1 or 2, found shape {graphs_array.shape}"
          )
  
      flat_graphs = graphs_array.ravel()
  
      if isinstance(flat_graphs[0], StellarGraph):
          self._check_graphs(flat_graphs)
          graphs = flat_graphs
          selected_ilocs = np.arange(len(graphs)).reshape(
              graphs_array.shape
          )
      else:
          selected_ilocs = graphs_array
          graphs = self.graphs
  
      return PaddedGraphSequence(
          graphs=graphs,
          selected_ilocs=selected_ilocs,
          targets=targets,
          symmetric_normalization=symmetric_normalization,
          weighted=weighted,
          batch_size=batch_size,
          name=name,
          shuffle=shuffle,
          seed=seed,
      )
  
imports: from ..core.graph import StellarGraph
  from ..core.utils import is_real_iterable, normalize_adj
  from ..random import random_state
  import numpy
  from tensorflow.keras.utils import Sequence
  from .base import Generator
label_desc: Use image node_id 4 for calling the PaddedGraphGenerator obj's underlying member method code with example usage: obj.flow(graphs, targets, symmetric_normalization, weighted, batch_size, name, shuffle, seed) and returns: PaddedGraphSequence