code: def __init__(self, datasets: List[ModalityDatasetItem]):
      id_to_mode = []
      dsets = []
      max_tokens = []
      max_sentences = []
      max_positions = []
      for dset in datasets:
          id_to_mode.append(dset.datasetname)
          dsets.append(dset.dataset)
          max_tokens.append(dset.max_tokens)
          max_positions.append(dset.max_positions)
          max_sentences.append(dset.max_sentences)
      weights = [1.0 for s in dsets]
      super().__init__(dsets, weights)
      self.max_tokens = max_tokens
      self.max_positions = max_positions
      self.max_sentences = max_sentences
      self.id_to_mode = id_to_mode
      self.raw_sub_batch_samplers = []
      self._cur_epoch = 0
  
imports: import logging
  import math
  from typing import List, Optional, NamedTuple
  import numpy
  import torch
  from fairseq.data import ConcatDataset, LanguagePairDataset, FileAudioDataset, data_utils
  from fairseq.data import FairseqDataset
label_desc: Use image node_id 1 to create a new MultiModalityDataset object from inherited base classes: ConcatDataset with example: obj = MultiModalityDataset(datasets)