code: def append_data(save_folder, data, corpus):
      """
      Make the csv corpora using data retrieved previously for one Media file.
  
      Arguments
      ---------
      save_folder: str
          Path where the csvs and preprocessed wavs will be stored.
      data: list
          channel, filename, speaker_name, sentences
      corpus: str
          Either 'train', 'dev', 'test', or 'test2'.
      """
  
      logger.info("Preparing " + corpus + ".csv")
  
      to_append = []
  
      for line in tqdm(data):
          channel, filename, speaker_name, sentences = line
  
          # Retrieve other necessary information
          out = subprocess.Popen(
              [
                  "soxi",
                  "-D",
                  save_folder + "/wav/" + channel + filename + ".wav",
              ],
              stdout=subprocess.PIPE,
              stderr=subprocess.STDOUT,
          )
          stdout, stderr = out.communicate()
          wav_duration = str("%.2f" % float(stdout))
          wav = save_folder + "/wav/" + channel + filename + ".wav"
          IDs = get_IDs(speaker_name, sentences, channel, filename)
  
          # Fill to_append list
          for n in range(len(sentences)):
              f1 = float(sentences[n][3])
              f2 = float(sentences[n][2])
              duration = str("%.2f" % (f1 - f2))
              if (
                  float(wav_duration) >= f1
                  and float(duration) != 0.0
                  and sentences[n][0] != ""
              ):
                  to_append.append(
                      [
                          IDs[n],
                          duration,
                          sentences[n][2],
                          sentences[n][3],
                          wav,
                          "wav",
                          speaker_name,
                          "string",
                          sentences[n][0],
                          "string",
                          sentences[n][1],
                          "string",
                      ]
                  )
  
      # Write to_append
      if to_append is not None:
          write_first_row(save_folder, corpus)
          path = save_folder + "/csv/" + corpus + ".csv"
          SB_file = open(path, "a")
          writer = csv.writer(SB_file, delimiter=",")
          writer.writerows(to_append)
          SB_file.close()
  
imports: import xml.dom.minidom
  from tqdm import tqdm
  import logging
  import subprocess
  import csv
  import os
  import glob
  import re
label_desc: Use image node_id 5 for calling a global function with example usage: append_data(save_folder, data, corpus) without return types