code: def collater(self, samples):
      if len(samples) == 0:
          return {}
      dataset_idx = samples[0][0]
      # make sure all samples in samples are from same dataset
      assert (
          sum([0 if dataset_idx == s[0] else 1 for s in samples]) == 0
      )
      samples = self.datasets[dataset_idx].collater(
          [x[1] for x in samples]
      )
      # add mode
      samples["net_input"]["mode"] = self.id_to_mode[dataset_idx]
  
      return samples
  
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 4 for calling the MultiModalityDataset obj's underlying member method code with example usage: obj.collater(samples) and returns: samples, dict