code: def generate_json(folder_path, split):
      yaml_file = read_file(folder_path + "/" + split + ".yaml")
      translations_file = read_file(folder_path + "/" + split + ".fra")
  
      assert len(yaml_file) == len(translations_file)
  
      output_json = dict()
      for i in range(len(yaml_file)):
          content = yaml_file[i]
          utt_id = content.split(", wav: ")[1].split("}")[0]
          output_json[utt_id] = dict()
          output_json[utt_id]["path"] = (
              folder_path.replace("/txt", "/wav")
              + "/"
              + utt_id
              + ".wav"
          )
          output_json[utt_id]["trans"] = translations_file[i]
          output_json[utt_id]["duration"] = content.split(
              "{duration: "
          )[1].split(",")[0]
  
      return output_json
  
imports: import json
  import os
label_desc: Use image node_id 2 for calling a global function with example usage: generate_json(folder_path, split) and returns: output_json