class_docstr: A data generator for node prediction with homogeneous GraphSAGE models
  on directed graphs.
  
  At minimum, supply the StellarDiGraph, the batch size, and the number of
  node samples (separately for in-nodes and out-nodes)
  for each layer of the GraphSAGE model.
  
  The supplied graph should be a StellarDiGraph 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.
  
  Example::
  
      G_generator = DirectedGraphSAGENodeGenerator(G, 50, [10,5], [5,1])
      train_data_gen = G_generator.flow(train_node_ids, train_node_labels)
      test_data_gen = G_generator.flow(test_node_ids)
  
  .. seealso::
  
     Model using this generator: :class:`.DirectedGraphSAGE`.
  
     Example using this generator: `node classification <https://stellargraph.readthedocs.io/en/stable/demos/connector/neo4j/directed-graphsage-on-cora-neo4j-example.html>`__.
  
     Related functionality: :class:`.DirectedGraphSAGENodeGenerator` for using :class:`.DirectedGraphSAGE` without Neo4j.
  
  Args:
      graph (Neo4jStellarDiGraph): Neo4jStellarGraph object
      batch_size (int): Size of batch to return.
      in_samples (list): The number of in-node samples per layer (hop) to take.
      out_samples (list): The number of out-node samples per layer (hop) to take.
      name (string, optional): Optional name for the generator
class_docstr_tok: ["A","data","generator","for","node","prediction","with","homogeneous","GraphSAGE","models","on","directed","graphs",".","At","minimum",",","supply","the","StellarDiGraph",",","the","batch","size",",","and","the","number","of","node","samples","(","separately","for","in-nodes","and","out-nodes",")","for","each","layer","of","the","GraphSAGE","model",".","The","supplied","graph","should","be","a","StellarDiGraph","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",".","Example",":",":","G_generator","=","DirectedGraphSAGENodeGenerator","(","G",",","50",",","[","10,5","]",",","[","5,1","]",")","train_data_gen","=","G_generator.flow","(","train_node_ids",",","train_node_labels",")","test_data_gen","=","G_generator.flow","(","test_node_ids",")","..","seealso",":",":","Model","using","this","generator",":",":","class",":","`",".DirectedGraphSAGE","`",".","Example","using","this","generator",":","`","node","classification","<","https",":","\/\/stellargraph.readthedocs.io\/en\/stable\/demos\/connector\/neo4j\/directed-graphsage-on-cora-neo4j-example.html",">","`","__",".","Related","functionality",":",":","class",":","`",".DirectedGraphSAGENodeGenerator","`","for","using",":","class",":","`",".DirectedGraphSAGE","`","without","Neo4j",".","Args",":","graph","(","Neo4jStellarDiGraph",")",":","Neo4jStellarGraph","object","batch_size","(","int",")",":","Size","of","batch","to","return",".","in_samples","(","list",")",":","The","number","of","in-node","samples","per","layer","(","hop",")","to","take",".","out_samples","(","list",")",":","The","number","of","out-node","samples","per","layer","(","hop",")","to","take",".","name","(","string",",","optional",")",":","Optional","name","for","the","generator"]
code: def __init__(
      self,
      graph,
      batch_size,
      in_samples,
      out_samples,
      name=None,
  ):
      super().__init__(graph, batch_size)
  
      # TODO Add checks for in- and out-nodes sizes
      self.in_samples = in_samples
      self.out_samples = out_samples
      self.name = name
  
      # Create sampler for GraphSAGE
      self.sampler = Neo4jDirectedBreadthFirstNeighbors(graph)
  
file_path: stellargraph/stellargraph/connector/neo4j/mapper.py
imports: import numpy
  import random
  from .sampler import Neo4jDirectedBreadthFirstNeighbors, Neo4jSampledBreadthFirstWalk
  from ...core.graph import GraphSchema
  from ...mapper import NodeSequence
  from ...mapper.sampled_node_generators import BatchedNodeGenerator
  from ...core.experimental import experimental
  from .graph import Neo4jStellarGraph
label_desc: Use image node_id 1 to create a new Neo4jDirectedGraphSAGENodeGenerator object from inherited base classes: Neo4jBatchedNodeGenerator with example: obj = Neo4jDirectedGraphSAGENodeGenerator(graph, batch_size, in_samples, out_samples, name)