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"]
docstr: Samples a list of blocks, as well as a subgraph containing the sampled
  edges from the original graph.
  
  If :attr:`negative_sampler` is given, also returns another graph containing the
  negative pairs as edges.
docstr_tok: ["Samples","a","list","of","blocks",",","as","well","as","a","subgraph","containing","the","sampled","edges","from","the","original","graph",".","If",":","attr",":","`","negative_sampler","`","is","given",",","also","returns","another","graph","containing","the","negative","pairs","as","edges","."]
code: def sample(self, g, seed_edges):  # pylint: disable=arguments-differ
      """Samples a list of blocks, as well as a subgraph containing the sampled
      edges from the original graph.
  
      If :attr:`negative_sampler` is given, also returns another graph containing the
      negative pairs as edges.
      """
      if isinstance(seed_edges, Mapping):
          seed_edges = {
              g.to_canonical_etype(k): v for k, v in seed_edges.items()
          }
      exclude = self.exclude
      pair_graph = g.edge_subgraph(
          seed_edges,
          relabel_nodes=False,
          output_device=self.output_device,
      )
      eids = pair_graph.edata[EID]
  
      if self.negative_sampler is not None:
          neg_graph = self._build_neg_graph(g, seed_edges)
          pair_graph, neg_graph = compact_graphs(
              [pair_graph, neg_graph]
          )
      else:
          pair_graph = compact_graphs(pair_graph)
  
      pair_graph.edata[EID] = eids
      seed_nodes = pair_graph.ndata[NID]
  
      exclude_eids = find_exclude_eids(
          g,
          seed_edges,
          exclude,
          self.reverse_eids,
          self.reverse_etypes,
          self.output_device,
      )
  
      input_nodes, _, blocks = self.sampler.sample(
          g, seed_nodes, exclude_eids
      )
  
      if self.negative_sampler is None:
          return self.assign_lazy_features(
              (input_nodes, pair_graph, blocks)
          )
      else:
          return self.assign_lazy_features(
              (input_nodes, pair_graph, neg_graph, blocks)
          )
  
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 4 for calling the EdgePredictionSampler obj's underlying member method code with example usage: obj.sample(g, seed_edges) and returns: self, self