class_docstr: Keras-compatible data generator to use with Keras methods :meth:`keras.Model.fit`,
  :meth:`keras.Model.evaluate`, and :meth:`keras.Model.predict`
  This class generates data samples for link inference models
  and should be created using the :meth:`flow` method of
  :class:`.GraphSAGELinkGenerator` or :class:`.HinSAGELinkGenerator` or :class:`.Attri2VecLinkGenerator`.
  
  Args:
      sample_function (Callable): A function that returns features for supplied head nodes.
      ids (iterable): Link IDs to batch, each link id being a tuple of (src, dst) node ids.
      targets (list, optional): A list of targets or labels to be used in the downstream task.
      shuffle (bool): If True (default) the ids will be randomly shuffled every epoch.
      seed (int, optional): Random seed
class_docstr_tok: ["Keras-compatible","data","generator","to","use","with","Keras","methods",":","meth",":","`","keras.Model.fit","`",",",":","meth",":","`","keras.Model.evaluate","`",",","and",":","meth",":","`","keras.Model.predict","`","This","class","generates","data","samples","for","link","inference","models","and","should","be","created","using","the",":","meth",":","`","flow","`","method","of",":","class",":","`",".GraphSAGELinkGenerator","`","or",":","class",":","`",".HinSAGELinkGenerator","`","or",":","class",":","`",".Attri2VecLinkGenerator","`",".","Args",":","sample_function","(","Callable",")",":","A","function","that","returns","features","for","supplied","head","nodes",".","ids","(","iterable",")",":","Link","IDs","to","batch",",","each","link","id","being","a","tuple","of","(","src",",","dst",")","node","ids",".","targets","(","list",",","optional",")",":","A","list","of","targets","or","labels","to","be","used","in","the","downstream","task",".","shuffle","(","bool",")",":","If","True","(","default",")","the","ids","will","be","randomly","shuffled","every","epoch",".","seed","(","int",",","optional",")",":","Random","seed"]
docstr: Denotes the number of batches per epoch
docstr_tok: ["Denotes","the","number","of","batches","per","epoch"]
code: def __len__(self):
      """Denotes the number of batches per epoch"""
      return int(np.ceil(self.data_size / self.batch_size))
  
imports: import warnings
  import operator
  import random
  import collections
  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 ..data.unsupervised_sampler import UnsupervisedSampler
  from ..core.utils import is_real_iterable
  from ..random import random_state
  from scipy import sparse
  from ..core.experimental import experimental
label_desc: Use image node_id 2 for calling the LinkSequence obj's underlying member method code with example usage: obj.__len__() and returns: int