code: def __init__(self, dataset):
      super().__init__(dataset)
  
      groups = dataset.groups
  
      items = zip(list(range(len(groups))), groups)
  
      item_to_group = {}
      group_to_items = {}
  
      for idx, group in items:
          item_to_group[idx] = group
  
          if group not in group_to_items:
              group_to_items[group] = [idx]
          else:
              group_to_items[group].append(idx)
  
      self.groups = set(groups)
      self.item_to_group = item_to_group
      self.group_to_items = group_to_items
  
file_path: backprop/backprop/utils/samplers.py
imports: import random
  import numpy
  from torch.utils.data.sampler import Sampler
label_desc: Use image node_id 1 to create a new SameGroupSampler object from inherited base classes: Sampler with example: obj = SameGroupSampler(dataset)