class_docstr: Sampler class that wraps an existing sampler for node classification into another
  one for edge classification or link prediction.
  
  See also
  --------
  as_edge_prediction_sampler
class_docstr_tok: ["Sampler","class","that","wraps","an","existing","sampler","for","node","classification","into","another","one","for","edge","classification","or","link","prediction",".","See","also","--","--","--","--","as_edge_prediction_sampler"]
code: def __init__(
      self,
      sampler,
      exclude=None,
      reverse_eids=None,
      reverse_etypes=None,
      negative_sampler=None,
      prefetch_labels=None,
  ):
      super().__init__()
      # Check if the sampler's sample method has an optional third argument.
      argspec = inspect.getfullargspec(sampler.sample)
      if (
          len(argspec.args) < 4
      ):  # ['self', 'g', 'indices', 'exclude_eids']
          raise TypeError(
              "This sampler does not support edge or link prediction; please add an"
              "optional third argument for edge IDs to exclude in its sample() method."
          )
      self.reverse_eids = reverse_eids
      self.reverse_etypes = reverse_etypes
      self.exclude = exclude
      self.sampler = sampler
      self.negative_sampler = negative_sampler
      self.prefetch_labels = prefetch_labels or []
      self.output_device = sampler.output_device
  
imports: import inspect
  from collections.abc import Mapping
  from ..None import backend
  from ..base import EID, NID
  from ..convert import heterograph
  from ..frame import LazyFeature
  from ..transforms import compact_graphs
  from ..utils import context_of, recursive_apply
label_desc: Use image node_id 1 to create a new EdgePredictionSampler object from inherited base classes: Sampler with example: obj = EdgePredictionSampler(sampler, exclude, reverse_eids, reverse_etypes, negative_sampler, prefetch_labels)