code: def prepare_libriparty(
      data_folder,
      save_json_folder,
      sample_rate=16000,
      window_size=5,
      skip_prep=False,
  ):
      """
      Prepares the json files for the LibriParty dataset.
  
      Arguments
      ---------
      data_folder : str
          Path to the folder where the original LibriSpeech dataset is stored.
      data_folder : str
          The path where to store the training json file.
      save_json_valid : str
          The path where to store the valid json file.
      save_json_test : str
          The path where to store the test json file.
      skip_prep: bool
          Default: False
          If True, the data preparation is skipped.
  
      Example
      -------
      >>> from recipes.LibriParty.libriparty_prepare import prepare_libriparty
      >>> data_folder = 'datasets/LibriParty'
      >>> prepare_libriparty(data_folder, 'train.json', 'valid.json', 'test.json')
      """
  
      # Skip if needed
      if skip_prep:
          return
  
      # Load datasets as json
      train_json = load_data_json(data_folder + "/metadata/train.json")
      valid_json = load_data_json(data_folder + "/metadata/dev.json")
      eval_json = load_data_json(data_folder + "/metadata/eval.json")
  
      # Create dummy dataframe
      df_columns = pd.DataFrame(
          columns=[
              "start",
              "stop",
              "words",
              "rir",
              "utt_id",
              "file",
              "lvl",
              "channel",
              "rir_channel",
              "session_id",
          ]
      )
  
      # Create dataframes
      df_train = create_dataframe(df_columns, train_json)
      df_valid = create_dataframe(df_columns, valid_json)
      df_test = create_dataframe(df_columns, eval_json)
  
      # Merge overlapping intervals
      df_train = merge_overlapping_intervals(df_train)
      df_valid = merge_overlapping_intervals(df_valid)
      df_test = merge_overlapping_intervals(df_test)
  
      # Create json structure
      train_dict = create_json_structure(
          df_train, data_folder + "/train/session_"
      )
      valid_dict = create_json_structure(
          df_valid, data_folder + "/dev/session_"
      )
      test_dict = create_json_structure(
          df_test, data_folder + "/eval/session_"
      )
  
      # Create datasets as json
      train_dataset = create_json_dataset(
          train_dict, sample_rate, window_size
      )
      valid_dataset = create_json_dataset(
          valid_dict, sample_rate, window_size
      )
      test_dataset = create_json_dataset(
          test_dict, sample_rate, window_size
      )
  
      # Save datasets
      save_dataset(save_json_folder + "/train.json", train_dataset)
      save_dataset(save_json_folder + "/valid.json", valid_dataset)
      save_dataset(save_json_folder + "/test.json", test_dataset)
  
file_path: speechbrain/recipes/LibriParty/VAD/libriparty_prepare.py
imports: import numpy
  import pandas
  import json
  import logging
  from collections import OrderedDict
label_desc: Use image node_id 12 for calling a global function with example usage: prepare_libriparty(data_folder, save_json_folder, sample_rate, window_size, skip_prep) without return types