code: def prepare_train(
      save_json_train,
      save_json_valid,
      save_json_test=None,
      split_ratio=[80, 20],
      win_len=0.02,
      stride=0.02,
      seed=12,
      emovdb_folder=None,
      esd_folder=None,
      iemocap_folder=None,
      jlcorpus_folder=None,
      ravdess_folder=None,
  ):
      """training sets preparation
  
      Args:
          save_json_train (str): train json path
          save_json_valid (str): valid json path
          save_json_test (str, None): Defaults to None for the current recipe.
          split_ratio (list, optional): train/valid split. Defaults to [80, 20].
          win_len (float, optional):
              window length for generating emotion labels. Defaults to 0.02.
          stride (float, optional):
              stride for generating emotion labels. Defaults to 0.02.
          seed (int, optional): train/valid test. Defaults to 12.
          emovdb_folder (str, optional): path to dataset. Defaults to None.
          esd_folder (str, optional): path to dataset. Defaults to None.
          iemocap_folder (str, optional): path to dataset. Defaults to None.
          jlcorpus_folder (str, optional): path to dataset. Defaults to None.
          ravdess_folder (str, optional): path to dataset. Defaults to None.
      """
      # setting seeds for reproducible code.
      random.seed(seed)
  
      if os.path.exists(save_json_train) and os.path.exists(
          save_json_valid
      ):
          logger.info(
              "train/valid json both exist, skipping preparation."
          )
          return
  
      all_dict = {}
      check_and_prepare_dataset(
          emovdb_folder, "EMOV-DB", prepare_emovdb, all_dict, seed
      )
  
      check_and_prepare_dataset(
          esd_folder, "ESD", prepare_esd, all_dict, seed
      )
  
      check_and_prepare_dataset(
          iemocap_folder, "IEMOCAP", prepare_iemocap, all_dict, seed
      )
      check_and_prepare_dataset(
          jlcorpus_folder, "JL_CORPUS", prepare_jlcorpus, all_dict, seed
      )
      check_and_prepare_dataset(
          ravdess_folder, "RAVDESS", prepare_ravdess, all_dict, seed
      )
  
      bad_keys = []
      for key in all_dict.keys():
          try:
              intervals, ctc_label, frame_label = get_labels(
                  all_dict[key], win_len, stride
              )
              all_dict[key]["frame_label"] = frame_label
              all_dict[key]["ctc_label"] = ctc_label
          except ValueError:
              logger.info(
                  f"Impossible to get labels for id {key} because the window is too large."
              )
              bad_keys.append(key)
              continue
      for key in bad_keys:
          del all_dict[key]
  
      data_split = split_sets(all_dict, split_ratio)
  
      train_ids = data_split["train"]
      train_split = {}
      for id in train_ids:
          train_split[id] = all_dict[id]
  
      valid_ids = data_split["valid"]
      valid_split = {}
      for id in valid_ids:
          valid_split[id] = all_dict[id]
  
      create_json(train_split, save_json_train)
      create_json(valid_split, save_json_valid)
      if save_json_test is not None:
          test_ids = data_split["test"]
          test_split = {}
          for id in test_ids:
              test_split[id] = all_dict[id]
          create_json(test_split, save_json_test)
  
file_path: speechbrain/recipes/ZaionEmotionDataset/emotion_diarization/zed_prepare.py
imports: import os
  import random
  import json
  import logging
  from datasets.prepare_EMOVDB import prepare_emovdb
  from datasets.prepare_ESD import prepare_esd
  from datasets.prepare_IEMOCAP import prepare_iemocap
  from datasets.prepare_JLCORPUS import prepare_jlcorpus
  from datasets.prepare_RAVDESS import prepare_ravdess
label_desc: Use image node_id 3 for calling a global function with example usage: prepare_train(save_json_train, save_json_valid, save_json_test, split_ratio, win_len, stride, seed, emovdb_folder, esd_folder, iemocap_folder, jlcorpus_folder, ravdess_folder) without return types