code: def __getitem__(self, idx):
      final_sample = {}
      for dataset in self.datasets:
          curr_sample = dataset[idx]
          assert isinstance(
              curr_sample, dict
          ), "Merge dataset only supports dicts"
          for key in curr_sample.keys():
              # If keys are distinct, then
              if key not in final_sample:
                  final_sample[key] = curr_sample[key]
              elif not isinstance(final_sample[key], list):
                  final_sample[key] = [
                      final_sample[key],
                      curr_sample[key],
                  ]
              else:
                  final_sample[key].append(curr_sample[key])
  
      return final_sample
  
label_desc: Use image node_id 2 for calling the MergeDataset obj's underlying member method code with example usage: obj.__getitem__(idx) and returns: final_sample