class_docstr: A wrapper of repeated dataset with repeat factor.
  
  Suitable for training on class imbalanced datasets like LVIS. Following
  the sampling strategy in the `paper <https://arxiv.org/abs/1908.03195>`_,
  in each epoch, an image may appear multiple times based on its
  "repeat factor".
  The repeat factor for an image is a function of the frequency the rarest
  category labeled in that image. The "frequency of category c" in [0, 1]
  is defined by the fraction of images in the training set (without repeats)
  in which category c appears.
  The dataset needs to instantiate :func:`self.get_cat_ids` to support
  ClassBalancedDataset.
  
  The repeat factor is computed as followed.
  
  1. For each category c, compute the fraction # of images
     that contain it: :math:`f(c)`
  2. For each category c, compute the category-level repeat factor:
     :math:`r(c) = max(1, sqrt(t/f(c)))`
  3. For each image I, compute the image-level repeat factor:
     :math:`r(I) = max_{c in I} r(c)`
  
  Args:
      dataset (:obj:`CustomDataset`): The dataset to be repeated.
      oversample_thr (float): frequency threshold below which data is
          repeated. For categories with ``f_c >= oversample_thr``, there is
          no oversampling. For categories with ``f_c < oversample_thr``, the
          degree of oversampling following the square-root inverse frequency
          heuristic above.
      filter_empty_gt (bool, optional): If set true, images without bounding
          boxes will not be oversampled. Otherwise, they will be categorized
          as the pure background class and involved into the oversampling.
          Default: True.
code: def __getitem__(self, idx):
      ori_index = self.repeat_indices[idx]
      return self.dataset[ori_index]
  
imports: import bisect
  import math
  from collections import defaultdict
  import numpy
  from mmcv.utils import print_log
  from torch.utils.data.dataset import ConcatDataset
  from .builder import DATASETS
  from .coco import CocoDataset
label_desc: Use image node_id 3 for calling the ClassBalancedDataset obj's underlying member method code with example usage: obj.__getitem__(idx) and returns: self