class_docstr: An abstract base class that initializes a graph sampler and provides
  :meth:`sample_from_nodes` and :meth:`sample_from_edges` routines.
  
  .. note ::
  
      Any data stored in the sampler will be *replicated* across data loading
      workers that use the sampler since each data loading worker holds its
      own instance of a sampler.
      As such, it is recommended to limit the amount of information stored in
      the sampler.
docstr: Performs sampling from the edges specified in :obj:`index`,
  returning a sampled subgraph in the specified output format.
  
  The :obj:`index` is a tuple holding the following information:
  
  1. The example indices of the seed links
  2. The source node indices to start sampling from
  3. The destination node indices to start sampling from
  4. The labels of the seed links (optional)
  5. The timestamps of the given seed nodes (optional)
  
  Args:
      index (EdgeSamplerInput): The edge sampler input object.
      neg_sampling (NegativeSampling, optional): The negative sampling
          configuration. (default: :obj:`None`)
docstr_tok: ["Performs","sampling","from","the","edges","specified","in",":","obj",":","`","index","`",",","returning","a","sampled","subgraph","in","the","specified","output","format",".","The",":","obj",":","`","index","`","is","a","tuple","holding","the","following","information",":","1",".","The","example","indices","of","the","seed","links","2",".","The","source","node","indices","to","start","sampling","from","3",".","The","destination","node","indices","to","start","sampling","from","4",".","The","labels","of","the","seed","links","(","optional",")","5",".","The","timestamps","of","the","given","seed","nodes","(","optional",")","Args",":","index","(","EdgeSamplerInput",")",":","The","edge","sampler","input","object",".","neg_sampling","(","NegativeSampling",",","optional",")",":","The","negative","sampling","configuration",".","(","default",":",":","obj",":","`","None","`",")"]
code: def sample_from_edges(
      self,
      index: EdgeSamplerInput,
      neg_sampling: Optional[NegativeSampling] = None,
  ) -> Union[HeteroSamplerOutput, SamplerOutput]:
      r"""Performs sampling from the edges specified in :obj:`index`,
      returning a sampled subgraph in the specified output format.
  
      The :obj:`index` is a tuple holding the following information:
  
      1. The example indices of the seed links
      2. The source node indices to start sampling from
      3. The destination node indices to start sampling from
      4. The labels of the seed links (optional)
      5. The timestamps of the given seed nodes (optional)
  
      Args:
          index (EdgeSamplerInput): The edge sampler input object.
          neg_sampling (NegativeSampling, optional): The negative sampling
              configuration. (default: :obj:`None`)
      """
      raise NotImplementedError
  
imports: import copy
  import math
  import warnings
  from abc import ABC
  from collections import defaultdict
  from dataclasses import dataclass
  from enum import Enum
  from typing import Any, Dict, List, Optional, Union
  import torch
  from torch import Tensor
  from torch_geometric.data import Data, FeatureStore, GraphStore, HeteroData
  from torch_geometric.sampler.utils import to_bidirectional
  from torch_geometric.typing import EdgeType, EdgeTypeStr, NodeType, OptTensor
  from torch_geometric.utils.mixin import CastMixin
label_desc: Use image node_id 2 for calling the BaseSampler obj's underlying member method code with example usage: obj.sample_from_edges(index, neg_sampling) without return types