class_docstr: A data generator for context node prediction with the attri2vec model.
  
  At minimum, supply the StellarGraph and the batch size.
  
  The supplied graph should be a StellarGraph object with node features.
  
  Use the :meth:`flow` method supplying the nodes and targets,
  or an UnsupervisedSampler instance that generates node samples on demand,
  to get an object that can be used as a Keras data generator.
  
  Example::
  
      G_generator = Attri2VecLinkGenerator(G, 50)
      train_data_gen = G_generator.flow(edge_ids, edge_labels)
  
  .. seealso::
  
     Model using this generator: :class:`.Attri2Vec`.
  
     An example using this generator (see the model for more): `link prediction <https://stellargraph.readthedocs.io/en/stable/demos/link-prediction/attri2vec-link-prediction.html>`__.
  
     Related functionality:
  
     - :class:`.UnsupervisedSampler` for unsupervised training using random walks
     - :class:`.Attri2VecNodeGenerator` for node classification and related tasks
  
  Args:
      G (StellarGraph): A machine-learning ready graph.
      batch_size (int): Size of batch of links to return.
      name, optional: Name of generator.
class_docstr_tok: ["A","data","generator","for","context","node","prediction","with","the","attri2vec","model",".","At","minimum",",","supply","the","StellarGraph","and","the","batch","size",".","The","supplied","graph","should","be","a","StellarGraph","object","with","node","features",".","Use","the",":","meth",":","`","flow","`","method","supplying","the","nodes","and","targets",",","or","an","UnsupervisedSampler","instance","that","generates","node","samples","on","demand",",","to","get","an","object","that","can","be","used","as","a","Keras","data","generator",".","Example",":",":","G_generator","=","Attri2VecLinkGenerator","(","G",",","50",")","train_data_gen","=","G_generator.flow","(","edge_ids",",","edge_labels",")","..","seealso",":",":","Model","using","this","generator",":",":","class",":","`",".Attri2Vec","`",".","An","example","using","this","generator","(","see","the","model","for","more",")",":","`","link","prediction","<","https",":","\/\/stellargraph.readthedocs.io\/en\/stable\/demos\/link-prediction\/attri2vec-link-prediction.html",">","`","__",".","Related","functionality",":","-",":","class",":","`",".UnsupervisedSampler","`","for","unsupervised","training","using","random","walks","-",":","class",":","`",".Attri2VecNodeGenerator","`","for","node","classification","and","related","tasks","Args",":","G","(","StellarGraph",")",":","A","machine-learning","ready","graph",".","batch_size","(","int",")",":","Size","of","batch","of","links","to","return",".","name",",","optional",":","Name","of","generator","."]
code: def __init__(self, G, batch_size, name=None):
      super().__init__(G, batch_size)
  
      self.name = name
  
imports: import random
  import operator
  import numpy
  import itertools
  import operator
  import collections
  import abc
  import warnings
  from functools import reduce
  from tensorflow import keras
  from ..core.graph import StellarGraph, GraphSchema
  from ..data import SampledBreadthFirstWalk, SampledHeterogeneousBreadthFirstWalk, UniformRandomWalk, UnsupervisedSampler, DirectedBreadthFirstNeighbours
  from ..core.utils import is_real_iterable
  from .None import LinkSequence, OnDemandLinkSequence
  from ..random import SeededPerBatch
  from .base import Generator
label_desc: Use image node_id 1 to create a new Attri2VecLinkGenerator object from inherited base classes: BatchedLinkGenerator with example: obj = Attri2VecLinkGenerator(G, batch_size, name)