code: def build_dataset_from_multiple_imdbs(
      config, dataset_cls, dataset_type
  ):
      from mmf.datasets.concat_dataset import MMFConcatDataset
  
      if dataset_type not in config.imdb_files:
          warnings.warn(
              "Dataset type {} is not present in "
              "imdb_files of dataset config. Returning None. "
              "This dataset won't be used.".format(dataset_type)
          )
          return None
  
      imdb_files = config["imdb_files"][dataset_type]
  
      datasets = []
  
      for imdb_idx in range(len(imdb_files)):
          dataset = dataset_cls(dataset_type, imdb_idx, config)
          datasets.append(dataset)
  
      dataset = MMFConcatDataset(datasets)
  
      return dataset
  
imports: import warnings
  from typing import List
  import torch
  from mmf.common.sample import Sample
  from omegaconf import DictConfig
label_desc: Use image node_id 2 for calling a global function with example usage: build_dataset_from_multiple_imdbs(config, dataset_cls, dataset_type) and returns: dataset, None