code: def get_individual_chunk_db(ds_id, ds_info):
      """Load individual dataset's chunk DB."""
      db_paths = sorted(glob.glob(ds_info["db_dir"] + "/*hdf5"))
      # *Note*: convert to dataset, rather than copying to memory.
      db = np.zeros((ds_info["n_chunks"], 5), dtype="uint32")
      db[:, 0] = ds_id
      start_idx = 0
      for db_path in db_paths:
          f = h5py.File(db_path, "r")
          n_chunks_current = f["chunks_valid"].shape[0]
          db[start_idx : (start_idx + n_chunks_current), 1:] = f[
              "chunks_valid"
          ]
          start_idx += n_chunks_current
          f.close()
  
      assert start_idx == ds_info["n_chunks"]
  
      return db
  
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 6 for calling a global function with example usage: get_individual_chunk_db(ds_id, ds_info) and returns: db