class_docstr: Base class for standard and DataParallel Sampler.
  
  Every subclass should implement `__iter__` method, providing a way to iterate
  over indices of dataset elements.
  
  Args:
      opts: command line argument
      n_data_samples: Number of samples in the dataset
      is_training: Training mode or not. Default: False
class_docstr_tok: ["Base","class","for","standard","and","DataParallel","Sampler",".","Every","subclass","should","implement","`","__iter__","`","method",",","providing","a","way","to","iterate","over","indices","of","dataset","elements",".","Args",":","opts",":","command","line","argument","n_data_samples",":","Number","of","samples","in","the","dataset","is_training",":","Training","mode","or","not",".","Default",":","False"]
docstr: Returns a list of indices of dataset elements to iterate over.
  
  ...note:
      If repeated augmentation is enabled, then indices will be repeated.
docstr_tok: ["Returns","a","list","of","indices","of","dataset","elements","to","iterate","over",".","...","note",":","If","repeated","augmentation","is","enabled",",","then","indices","will","be","repeated","."]
code: def get_indices(self) -> List[int]:
      """Returns a list of indices of dataset elements to iterate over.
  
      ...note:
          If repeated augmentation is enabled, then indices will be repeated.
      """
      img_indices = copy.deepcopy(self.img_indices)
      if self.shuffle:
          random.seed(self.epoch)
          random.shuffle(img_indices)
  
          if self.num_repeats > 1:
              # Apply repeated augmentation
              """Assume that we have [0, 1, 2, 3] samples. With repeated augmentation,
              we first repeat the samples [0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3] and then select 4
              samples [0, 0, 0, 1]. Note that we do shuffle at the beginning, so samples are not the
              same at every iteration.
              """
              n_samples_before_repeat = len(img_indices)
              img_indices = np.repeat(
                  img_indices, repeats=self.num_repeats
              )
              img_indices = list(img_indices)
              if self.trunc_rep_aug:
                  img_indices = img_indices[:n_samples_before_repeat]
      return img_indices
  
imports: import argparse
  import copy
  import math
  import random
  from typing import Any, Iterator, List, Tuple
  import numpy
  import torch
  import torch.distributed
  from torch.utils.data.sampler import Sampler
label_desc: Use image node_id 3 for calling the BaseSampler obj's underlying member method code with example usage: obj.get_indices() and returns: img_indices