code: def build_dataset(cfg, default_args=None):
      from .dataset_wrappers import (
          ConcatDataset,
          RepeatDataset,
          ClassBalancedDataset,
      )
  
      if isinstance(cfg, (list, tuple)):
          dataset = ConcatDataset(
              [build_dataset(c, default_args) for c in cfg]
          )
      elif cfg["type"] == "ConcatDataset":
          dataset = ConcatDataset(
              [build_dataset(c, default_args) for c in cfg["datasets"]],
              cfg.get("separate_eval", True),
          )
      elif cfg["type"] == "RepeatDataset":
          dataset = RepeatDataset(
              build_dataset(cfg["dataset"], default_args), cfg["times"]
          )
      elif cfg["type"] == "ClassBalancedDataset":
          dataset = ClassBalancedDataset(
              build_dataset(cfg["dataset"], default_args),
              cfg["oversample_thr"],
          )
      elif isinstance(cfg.get("ann_file"), (list, tuple)):
          dataset = _concat_dataset(cfg, default_args)
      else:
          dataset = build_from_cfg(cfg, DATASETS, default_args)
  
      return dataset
  
file_path: insightface/detection/scrfd/mmdet/datasets/builder.py
imports: import copy
  import platform
  import random
  from functools import partial
  import numpy
  from mmcv.parallel import collate
  from mmcv.runner import get_dist_info
  from mmcv.utils import Registry, build_from_cfg
  from torch.utils.data import DataLoader
  from .samplers import DistributedGroupSampler, DistributedSampler, GroupSampler
label_desc: Use image node_id 2 for calling a global function with example usage: build_dataset(cfg, default_args) and returns: dataset