class_docstr: A subgraph sampler used to sample a subgraph from a given set of nodes
  from a larger graph.
  
  Functional name: :obj:`sample_subgraph`.
  
  This class is the base class of all subgraph samplers. Any subclass of
  SubgraphSampler should implement the :meth:`sample_subgraphs` method.
  
  Parameters
  ----------
  datapipe : DataPipe
      The datapipe.
code: def _sample(self, minibatch):
      if minibatch.node_pairs is not None:
          (
              seeds,
              seeds_timestamp,
              minibatch.compacted_node_pairs,
              minibatch.compacted_negative_srcs,
              minibatch.compacted_negative_dsts,
          ) = self._node_pairs_preprocess(minibatch)
      elif minibatch.seed_nodes is not None:
          seeds = minibatch.seed_nodes
          seeds_timestamp = (
              minibatch.timestamp
              if hasattr(minibatch, "timestamp")
              else None
          )
      else:
          raise ValueError(
              f"Invalid minibatch {minibatch}: Either `node_pairs` or "
              "`seed_nodes` should have a value."
          )
      (
          minibatch.input_nodes,
          minibatch.sampled_subgraphs,
      ) = self.sample_subgraphs(seeds, seeds_timestamp)
      return minibatch
  
file_path: dgl/python/dgl/graphbolt/subgraph_sampler.py
imports: from collections import defaultdict
  from typing import Dict
  from torch.utils.data import functional_datapipe
  from .base import etype_str_to_tuple
  from .internal import compact_temporal_nodes, unique_and_compact
  from .minibatch_transformer import MiniBatchTransformer
label_desc: Use image node_id 2 for calling the SubgraphSampler obj's underlying member method code with example usage: obj._sample(minibatch) and returns: minibatch