code: def speaker_diarization_evaluation(folder_name, lda_dimensions):
      """
      This function prints the cluster purity and speaker purity for
      each WAV file stored in a provided directory (.SEGMENT files
       are needed as ground-truth)
      ARGUMENTS:
          - folder_name:     the full path of the folder where the WAV and
                             segment (ground-truth) files are stored
          - lda_dimensions:  a list of LDA dimensions (0 for no LDA)
      """
      types = ("*.wav",)
      wav_files = []
      for files in types:
          wav_files.extend(glob.glob(os.path.join(folder_name, files)))
  
      wav_files = sorted(wav_files)
  
      # get number of unique speakers per file (from ground-truth)
      num_speakers = []
      for wav_file in wav_files:
          gt_file = wav_file.replace(".wav", ".segments")
          if os.path.isfile(gt_file):
              _, _, seg_labs = read_segmentation_gt(gt_file)
              num_speakers.append(len(list(set(seg_labs))))
          else:
              num_speakers.append(-1)
  
      for dim in lda_dimensions:
          print("LDA = {0:d}".format(dim))
          for i, wav_file in enumerate(wav_files):
              speaker_diarization(
                  wav_file,
                  num_speakers[i],
                  2.0,
                  0.2,
                  0.05,
                  dim,
                  plot_res=False,
              )
  
imports: from __future__ import print_function
  import os
  import csv
  import glob
  import scipy
  import sklearn
  import numpy
  import hmmlearn.hmm
  import sklearn.cluster
  import pickle
  import matplotlib.pyplot
  from scipy.spatial import distance
  import sklearn.discriminant_analysis
  from sklearn.preprocessing import StandardScaler
  import sys
  import pyAudioAnalysis.audioBasicIO
  import pyAudioAnalysis.audioTrainTest
  import pyAudioAnalysis.MidTermFeatures
  import pyAudioAnalysis.ShortTermFeatures
label_desc: Use image node_id 21 for calling a global function with example usage: speaker_diarization_evaluation(folder_name, lda_dimensions) without return types