code: def __iter__(self):
      indices = []
      for i, size in enumerate(self.group_sizes):
          if size == 0:
              continue
          indice = np.where(self.flag == i)[0]
          assert len(indice) == size
          np.random.shuffle(indice)
          num_extra = int(
              np.ceil(size / self.samples_per_gpu)
          ) * self.samples_per_gpu - len(indice)
          indice = np.concatenate(
              [indice, np.random.choice(indice, num_extra)]
          )
          indices.append(indice)
      indices = np.concatenate(indices)
      indices = [
          indices[
              i * self.samples_per_gpu : (i + 1) * self.samples_per_gpu
          ]
          for i in np.random.permutation(
              range(len(indices) // self.samples_per_gpu)
          )
      ]
      indices = np.concatenate(indices)
      indices = indices.astype(np.int64).tolist()
      assert len(indices) == self.num_samples
      return iter(indices)
  
file_path: insightface/detection/scrfd/mmdet/datasets/samplers/group_sampler.py
imports: from __future__ import division
  import math
  import numpy
  import torch
  from mmcv.runner import get_dist_info
  from torch.utils.data import Sampler
label_desc: Use image node_id 2 for calling the GroupSampler obj's underlying member method code with example usage: obj.__iter__() and returns: iter