code: def __init__(
      self, G, batch_size, schema=None, use_node_features=True
  ):
      if not isinstance(G, StellarGraph):
          raise TypeError(
              "Graph must be a StellarGraph or StellarDiGraph object."
          )
  
      self.graph = G
      self.batch_size = batch_size
  
      # This is a link generator and requries a model with two root nodes per query
      self.multiplicity = 2
  
      # We need a schema for compatibility with HinSAGE
      if schema is None:
          self.schema = G.create_graph_schema()
      elif isinstance(schema, GraphSchema):
          self.schema = schema
      else:
          raise TypeError("Schema must be a GraphSchema object")
  
      # Do we need real node types here?
      self.head_node_types = None
  
      # Sampler (if required)
      self.sampler = None
  
      # Check if the graph has features
      if use_node_features:
          G.check_graph_for_ml()
  
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 BatchedLinkGenerator object from inherited base classes: Generator with example: obj = BatchedLinkGenerator(G, batch_size, schema, use_node_features)