code: def reorg_datasets_by_split(datasets):
      """
      Organizes datasets by split.
  
      Args:
          datasets: dict of torch.utils.data.Dataset objects by name.
  
      Returns:
          Dict of datasets by split {split_name: List[Datasets]}.
      """
      # if len(datasets) == 1:
      #     return datasets[list(datasets.keys())[0]]
      # else:
      reorg_datasets = dict()
  
      # reorganize by split
      for _, dataset in datasets.items():
          for split_name, dataset_split in dataset.items():
              if split_name not in reorg_datasets:
                  reorg_datasets[split_name] = [dataset_split]
              else:
                  reorg_datasets[split_name].append(dataset_split)
  
      return reorg_datasets
  
imports: import gzip
  import logging
  import os
  import random
  import tarfile
  import zipfile
  import cv2
  import decord
  import webdataset
  import numpy
  import torch
  from torch.utils.data.dataset import IterableDataset, ChainDataset
  from decord import VideoReader
  from lavis.common.registry import registry
  from lavis.datasets.datasets.base_dataset import ConcatDataset
  from tqdm import tqdm
label_desc: Use image node_id 5 for calling a global function with example usage: reorg_datasets_by_split(datasets) and returns: reorg_datasets