class_docstr: A data generator for node representation prediction with Node2Vec models.
  
  At minimum, supply the StellarGraph and the batch size.
  
  The supplied graph should be a StellarGraph object that is ready for
  machine learning. Currently the model does not require node features for
  nodes in the graph.
  
  Use the :meth:`flow` method supplying the nodes to get an object
  that can be used as a Keras data generator.
  
  Example::
  
      G_generator = Node2VecNodeGenerator(G, 50)
      data_gen = G_generator.flow(node_ids)
  
  .. seealso::
  
     Model using this generator: :class:`.Node2Vec`.
  
     An example using this generator (see the model for more): `unsupervised representation learning <https://stellargraph.readthedocs.io/en/stable/demos/embeddings/keras-node2vec-embeddings.html>`_.
  
     Related functionality: :class:`.Node2VecLinkGenerator` for training, link prediction, and related tasks.
  
  Args:
      G (StellarGraph): The machine-learning ready graph.
      batch_size (int): Size of batch to return.
      name (str or None): Name of the generator (optional).
class_docstr_tok: ["A","data","generator","for","node","representation","prediction","with","Node2Vec","models",".","At","minimum",",","supply","the","StellarGraph","and","the","batch","size",".","The","supplied","graph","should","be","a","StellarGraph","object","that","is","ready","for","machine","learning",".","Currently","the","model","does","not","require","node","features","for","nodes","in","the","graph",".","Use","the",":","meth",":","`","flow","`","method","supplying","the","nodes","to","get","an","object","that","can","be","used","as","a","Keras","data","generator",".","Example",":",":","G_generator","=","Node2VecNodeGenerator","(","G",",","50",")","data_gen","=","G_generator.flow","(","node_ids",")","..","seealso",":",":","Model","using","this","generator",":",":","class",":","`",".Node2Vec","`",".","An","example","using","this","generator","(","see","the","model","for","more",")",":","`","unsupervised","representation","learning","<","https",":","\/\/stellargraph.readthedocs.io\/en\/stable\/demos\/embeddings\/keras-node2vec-embeddings.html",">","`","_",".","Related","functionality",":",":","class",":","`",".Node2VecLinkGenerator","`","for","training",",","link","prediction",",","and","related","tasks",".","Args",":","G","(","StellarGraph",")",":","The","machine-learning","ready","graph",".","batch_size","(","int",")",":","Size","of","batch","to","return",".","name","(","str","or","None",")",":","Name","of","the","generator","(","optional",")","."]
docstr: Creates a generator/sequence object for node representation prediction
  by using the index of the supplied dataframe as the node ids.
  
  Args:
      node_ids: a Pandas DataFrame of node_ids.
  
  Returns:
      A NodeSequence object to use with the Node2Vec model
      in the Keras method ``predict``.
code: def flow_from_dataframe(self, node_ids):
      """
      Creates a generator/sequence object for node representation prediction
      by using the index of the supplied dataframe as the node ids.
  
      Args:
          node_ids: a Pandas DataFrame of node_ids.
  
      Returns:
          A NodeSequence object to use with the Node2Vec model
          in the Keras method ``predict``.
      """
      node_ilocs = self.graph.node_ids_to_ilocs(node_ids.index)
      return NodeSequence(
          self.sample_features,
          self.batch_size,
          node_ilocs,
          shuffle=False,
      )
  
imports: import warnings
  import operator
  import random
  import abc
  import warnings
  import numpy
  import itertools
  import networkx
  import scipy.sparse
  from tensorflow.keras import backend
  from functools import reduce
  from tensorflow.keras.utils import Sequence
  from collections import defaultdict
  from ..data import SampledBreadthFirstWalk, SampledHeterogeneousBreadthFirstWalk, DirectedBreadthFirstNeighbours
  from ..core.graph import StellarGraph, GraphSchema
  from ..core.utils import is_real_iterable
  from ..core.validation import comma_sep
  from .None import NodeSequence, Generator
  from ..random import SeededPerBatch
label_desc: Use image node_id 4 for calling the Node2VecNodeGenerator obj's underlying member method code with example usage: obj.flow_from_dataframe(node_ids) and returns: NodeSequence