class_docstr: Conjugating class for a set of MegatronDataset instances
  
  Args:
      datasets (List[MegatronDataset]): The MegatronDataset instances to blend
  
      weights (List[float]): The weights which determines the dataset blend ratios
  
      size (int): The number of samples to draw from the blend
  
      config (BlendedMegatronDatasetConfig): The config object which informs dataset creation
  
  Raises:
      RuntimeError: When the dataset has fewer or more samples than 'size' post-initialization
class_docstr_tok: ["Conjugating","class","for","a","set","of","MegatronDataset","instances","Args",":","datasets","(","List","[","MegatronDataset","]",")",":","The","MegatronDataset","instances","to","blend","weights","(","List","[","float","]",")",":","The","weights","which","determines","the","dataset","blend","ratios","size","(","int",")",":","The","number","of","samples","to","draw","from","the","blend","config","(","BlendedMegatronDatasetConfig",")",":","The","config","object","which","informs","dataset","creation","Raises",":","RuntimeError",":","When","the","dataset","has","fewer","or","more","samples","than","'size","'","post-initialization"]
code: def __getitem__(
      self, idx: int
  ) -> Dict[str, Union[int, numpy.ndarray]]:
      dataset_id = self.dataset_index[idx]
      dataset_sample_id = self.dataset_sample_index[idx]
      return {
          "dataset_id": dataset_id,
          **self.datasets[dataset_id][dataset_sample_id],
      }
  
file_path: megatron-lm/megatron/core/datasets/blended_dataset.py
imports: import hashlib
  import json
  import logging
  import os
  import time
  from collections import OrderedDict
  from typing import Dict, List, Tuple, Union
  import numpy
  import torch
  from megatron.core.datasets.blended_megatron_dataset_config import BlendedMegatronDatasetConfig
  from megatron.core.datasets.megatron_dataset import MegatronDataset
  from megatron.core.datasets.utils import log_single_rank, normalize
label_desc: Use image node_id 3 for calling the BlendedDataset obj's underlying member method code with example usage: obj.__getitem__(idx) and returns: dict