code: def build_datasets(
      dataset_list: List[str],
      dataset_config: DictConfig,
      dataset_type="train",
  ) -> List[torch.utils.data.Dataset]:
      datasets = []
      for dataset in dataset_list:
          if dataset in dataset_config:
              dataset_config = dataset_config[dataset]
          else:
              warnings.warn(
                  f"Dataset {dataset} is missing from dataset_config"
                  + " in config. Proceeding with empty config."
              )
              dataset_config = OmegaConf.create()
  
          dataset_instance = build_dataset(
              dataset, dataset_config, dataset_type
          )
          if dataset_instance is None:
              continue
          datasets.append(dataset_instance)
  
      return datasets
  
imports: import logging
  import os
  import warnings
  from enum import Enum
  from typing import Any, Dict, List, Optional, Tuple, Union
  import mmf
  import pytorch_lightning
  import torch
  from mmf.common.meter import Meter
  from mmf.common.registry import registry
  from mmf.datasets.iteration_strategies import ConstantIterationStrategy, IterationStrategy, SizeProportionalIterationStrategy
  from mmf.datasets.processors.processors import Processor
  from mmf.utils.configuration import Configuration, get_global_config
  from mmf.utils.distributed import is_dist_initialized, is_main, is_xla, synchronize
  from mmf.utils.general import get_optimizer_parameters
  from omegaconf import DictConfig, OmegaConf
  from packaging import version
label_desc: Use image node_id 6 for calling a global function with example usage: build_datasets(dataset_list, dataset_config, dataset_type) and returns: datasets