class_docstr: Subset of a dataset at specified indices.
  
  Args:
      dataset (Dataset): The whole Dataset
      indices (sequence): Indices in the whole set selected for subset
class_docstr_tok: ["Subset","of","a","dataset","at","specified","indices",".","Args",":","dataset","(","Dataset",")",":","The","whole","Dataset","indices","(","sequence",")",":","Indices","in","the","whole","set","selected","for","subset"]
code: def __getitem__(self, idx):
      if isinstance(idx, list):
          return self.dataset[[self.indices[i] for i in idx]]
      return self.dataset[self.indices[idx]]
  
imports: import bisect
  import itertools
  import math
  import warnings
  from typing import cast, Dict, Generic, Iterable, List, Optional, Sequence, Tuple, TypeVar, Union
  from torch import default_generator, randperm
  from ...None import Generator, Tensor
label_desc: Use image node_id 2 for calling the Subset obj's underlying member method code with example usage: obj.__getitem__(idx) and returns: self, self