code: def process_files(args):
      sre18_dev_dir = args.sre18_dev_dir
      output_dir = os.path.join(args.output_dir, "sre18_dev_enroll")
      if not os.path.exists(output_dir):
          os.makedirs(output_dir)
      sampling_frequency = args.sampling_frequency
      # temp_dir = os.path.join(output_dir, 'tmp')
      # if not os.path.exists(temp_dir):
      #     os.makedirs(temp_dir)
  
      utt2spk = open(os.path.join(output_dir, "utt2spk"), "wt")
      wav_scp = open(os.path.join(output_dir, "wav.scp"), "wt")
      meta = open(
          os.path.join(sre18_dev_dir, "docs/sre18_dev_enrollment.tsv"),
          "rt",
      )
  
      meta.readline()  # header line
      line = meta.readline()
      utt2fixedutt = {}
      while line:
          tokens = line.split("\t")
          model_id, segment_id, side = tokens
          segment_id = segment_id.split(".")[0]
          utt2spk.write(
              "{spk}-{utt} {spk}\n".format(spk=model_id, utt=segment_id)
          )
          utt2fixedutt[segment_id] = "{spk}-{utt}".format(
              spk=model_id, utt=segment_id
          )
          line = meta.readline()
      utt2spk.close()
      meta.close()
  
      audio_files = os.listdir(
          os.path.join(sre18_dev_dir, "data/enrollment")
      )
      for file_name in audio_files:
          file_path = os.path.join(
              sre18_dev_dir, "data/enrollment/" + file_name
          )
          name, extension = file_name.split(".")
          write_to_wav_scp(
              wav_scp,
              sampling_frequency,
              extension,
              utt2fixedutt[name],
              file_path,
          )
      wav_scp.close()
  
      if (
          os.system(
              "utils/utt2spk_to_spk2utt.pl {out_dir}/utt2spk > {out_dir}/spk2utt".format(
                  out_dir=output_dir
              )
          )
          != 0
      ):
          raise Exception(
              "Error creating spk2utt file in directory {out_dir}".format(
                  out_dir=output_dir
              )
          )
  
      if (
          os.system(
              "utils/fix_data_dir.sh {out_dir}".format(
                  out_dir=output_dir
              )
          )
          != 0
      ):
          raise Exception(
              "Error fixing data dir {out_dir}".format(
                  out_dir=output_dir
              )
          )
  
      #################### TEST PART ####################
      output_dir = os.path.join(args.output_dir, "sre18_dev_test")
      if not os.path.exists(output_dir):
          os.makedirs(output_dir)
      # temp_dir = os.path.join(output_dir, 'tmp')
      # if not os.path.exists(temp_dir):
      #     os.makedirs(temp_dir)
  
      utt2spk = open(os.path.join(output_dir, "utt2spk"), "wt")
      wav_scp = open(os.path.join(output_dir, "wav.scp"), "wt")
      trials = open(os.path.join(output_dir, "trials"), "wt")
      trial_key = open(
          os.path.join(sre18_dev_dir, "docs/sre18_dev_trial_key.tsv"),
          "rt",
      )
      segment_key = open(
          os.path.join(sre18_dev_dir, "docs/sre18_dev_segment_key.tsv"),
          "rt",
      )
  
      segment_key.readline()  # header line
      line = segment_key.readline()
      utt2subject = {}
      while line:
          parts = line.split("\t")
          utt = parts[0].split(".")[0]
          subject = parts[1]
          utt2subject[utt] = subject
          line = segment_key.readline()
  
      audio_files = os.listdir(os.path.join(sre18_dev_dir, "data/test"))
      for file_name in audio_files:
          file_path = os.path.join(
              sre18_dev_dir, "data/test/" + file_name
          )
          name, extension = file_name.split(".")
          utt2spk.write("{utt} {utt}\n".format(utt=name))
          write_to_wav_scp(
              wav_scp, sampling_frequency, extension, name, file_path
          )
      wav_scp.close()
      utt2spk.close()
  
      trial_key.readline()  # header line
      line = trial_key.readline()
      while line:
          parts = line.split("\t")
          spk = parts[0]
          utt = parts[1].split(".")[0]
          target_type = parts[3]
          trials.write(
              "{spk} {utt} {target_type}\n".format(
                  spk=spk, utt=utt, target_type=target_type
              )
          )
          line = trial_key.readline()
      trials.close()
  
      if (
          os.system(
              "utils/utt2spk_to_spk2utt.pl {out_dir}/utt2spk > {out_dir}/spk2utt".format(
                  out_dir=output_dir
              )
          )
          != 0
      ):
          raise Exception(
              "Error creating spk2utt file in directory {out_dir}".format(
                  out_dir=output_dir
              )
          )
  
      if (
          os.system(
              "utils/fix_data_dir.sh {out_dir}".format(
                  out_dir=output_dir
              )
          )
          != 0
      ):
          raise Exception(
              "Error fixing data dir {out_dir}".format(
                  out_dir=output_dir
              )
          )
  
      #################### UNLABELED PART ####################
      output_dir = os.path.join(args.output_dir, "sre18_dev_unlabeled")
      if not os.path.exists(output_dir):
          os.makedirs(output_dir)
  
      utt2spk = open(os.path.join(output_dir, "utt2spk"), "wt")
      wav_scp = open(os.path.join(output_dir, "wav.scp"), "wt")
  
      audio_files = os.listdir(
          os.path.join(sre18_dev_dir, "data/unlabeled")
      )
      for file_name in audio_files:
          file_path = os.path.join(
              sre18_dev_dir, "data/unlabeled/" + file_name
          )
          name, extension = file_name.split(".")
          utt2spk.write("{utt} {utt}\n".format(utt=name))
          write_to_wav_scp(
              wav_scp, sampling_frequency, extension, name, file_path
          )
      wav_scp.close()
      utt2spk.close()
  
      if (
          os.system(
              "utils/utt2spk_to_spk2utt.pl {out_dir}/utt2spk > {out_dir}/spk2utt".format(
                  out_dir=output_dir
              )
          )
          != 0
      ):
          raise Exception(
              "Error creating spk2utt file in directory {out_dir}".format(
                  out_dir=output_dir
              )
          )
  
      if (
          os.system(
              "utils/fix_data_dir.sh {out_dir}".format(
                  out_dir=output_dir
              )
          )
          != 0
      ):
          raise Exception(
              "Error fixing data dir {out_dir}".format(
                  out_dir=output_dir
              )
          )
  
file_path: delta/egs/sre16/v1/local/make_sre18_eval.py
imports: import threading
  import warnings
  import argparse
  import os
  import sys
  import traceback
label_desc: Use image node_id 4 for calling a global function with example usage: process_files(args) without return types