class_docstr: Base class for graph samplers.
  
  All graph samplers must subclass this class and override the ``sample``
  method.
  
  .. code:: python
  
      from dgl.dataloading import Sampler
  
      class SubgraphSampler(Sampler):
          def __init__(self):
              super().__init__()
  
          def sample(self, g, indices):
              return g.subgraph(indices)
class_docstr_tok: ["Base","class","for","graph","samplers",".","All","graph","samplers","must","subclass","this","class","and","override","the","``","sample","``","method",".","..","code",":",":","python","from","dgl.dataloading","import","Sampler","class","SubgraphSampler","(","Sampler",")",":","def","__init__","(","self",")",":","super","(",")",".__init__","(",")","def","sample","(","self",",","g",",","indices",")",":","return","g.subgraph","(","indices",")"]
docstr: Abstract sample method.
  
  Parameters
  ----------
  g : DGLGraph
      The graph.
  indices : object
      Any object representing the indices selected in the current minibatch.
docstr_tok: ["Abstract","sample","method",".","Parameters","--","--","--","--","--","g",":","DGLGraph","The","graph",".","indices",":","object","Any","object","representing","the","indices","selected","in","the","current","minibatch","."]
code: def sample(self, g, indices):
      """Abstract sample method.
  
      Parameters
      ----------
      g : DGLGraph
          The graph.
      indices : object
          Any object representing the indices selected in the current minibatch.
      """
      raise NotImplementedError
  
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 for calling the Sampler obj's underlying member method code with example usage: obj.sample(g, indices) without return types