code: def train_speaker_models():
      """
      This script is used to train the speaker-related models
      (NOTE: data paths are hard-coded and NOT included in the library,
      the models are, however included)
           import audioTrainTest as aT
          aT.trainSpeakerModelsScript()
  
      """
      mt_win = 2.0
      mt_step = 2.0
      st_win = 0.020
      st_step = 0.020
  
      dir_name = "DIARIZATION_ALL/all"
      list_of_dirs = [
          os.path.join(dir_name, name)
          for name in os.listdir(dir_name)
          if os.path.isdir(os.path.join(dir_name, name))
      ]
      extract_features_and_train(
          list_of_dirs,
          mt_win,
          mt_step,
          st_win,
          st_step,
          "knn",
          "data/knnSpeakerAll",
          compute_beat=False,
          train_percentage=0.50,
      )
  
      dir_name = "DIARIZATION_ALL/female_male"
      list_of_dirs = [
          os.path.join(dir_name, name)
          for name in os.listdir(dir_name)
          if os.path.isdir(os.path.join(dir_name, name))
      ]
      extract_features_and_train(
          list_of_dirs,
          mt_win,
          mt_step,
          st_win,
          st_step,
          "knn",
          "data/knnSpeakerFemaleMale",
          compute_beat=False,
          train_percentage=0.50,
      )
  
imports: from __future__ import print_function
  from imblearn.under_sampling import RandomUnderSampler
  from imblearn.over_sampling import SMOTE
  from sklearn.model_selection import GroupShuffleSplit
  from pyAudioAnalysis import audioBasicIO
  from pyAudioAnalysis import MidTermFeatures
  import sys
  import numpy
  import os
  import glob
  import pickle
  import csv
  import ntpath
  from scipy import linalg
  from scipy.spatial import distance
  import sklearn.svm
  import sklearn.decomposition
  import sklearn.ensemble
  import plotly
  import plotly.subplots
  import plotly.graph_objs
  import sklearn.metrics
  from sklearn.model_selection import train_test_split
  from sklearn.preprocessing import StandardScaler
label_desc: Use image node_id 26 for calling a global function with example usage: train_speaker_models() without return types