code: def get_merged_dataset(db_type, indexed_dataset_infos=None):
      """Get merged dataset."""
  
      args = get_retro_args()
  
      if not indexed_dataset_infos:
          indexed_dataset_infos = get_indexed_dataset_infos()
  
      # Load chunks.
      db_path = get_merged_db_path_map()[db_type]
      f = h5py.File(db_path, "r")
      chunks = f["chunks"]
  
      # DB dataset.
      indexed_datasets = [
          info["dataset"] for info in indexed_dataset_infos
      ]
      dataset = DBDataset(
          db_path, indexed_datasets, chunks, args.retro_gpt_chunk_length
      )
  
      return dataset
  
imports: from collections import defaultdict
  import glob
  import json
  import numpy
  import os
  from tqdm import tqdm
  from megatron import get_retro_args, print_rank_0
  from megatron.core.datasets.indexed_dataset import MMapIndexedDataset
  from tools.retro.external_libs import h5py
  from .dataset import DBDataset
label_desc: Use image node_id 9 for calling a global function with example usage: get_merged_dataset(db_type, indexed_dataset_infos) and returns: dataset