code: def main(args):
      qmf_train_trial = args[0]
      qmf_train_trial2 = args[1]
      qmf_train_scores = args[2]
      qmf_train_embed_dic = args[3]
  
      test_trial = args[4]
      test_trial2 = args[5]
      test_scores = args[6]
      test_embed_dic = args[7]
  
      out_dir = args[8]
  
      qmf_utt2dir, qmf_train_scores, qmf_train_embed_dic = load_values(
          qmf_train_trial,
          qmf_train_trial2,
          qmf_train_scores,
          qmf_train_embed_dic,
      )
      train_data, train_labels = generate_data(
          qmf_utt2dir, qmf_train_scores, qmf_train_embed_dic
      )
  
      test_utt2dir, test_scores, test_embed_dic = load_values(
          test_trial,
          test_trial2,
          test_scores,
          test_embed_dic,
      )
      test_data, test_labels = generate_data(
          test_utt2dir, test_scores, test_embed_dic
      )
  
      # solver can be also newton-cholesky, lbfgs, and more.
      # check https://scikit-learn.org/stable/modules/generated/
      # sklearn.linear_model.LogisticRegression.html#sklearn.linear_model.
      # LogisticRegression.decision_function
      lr = LogisticRegression(random_state=0, solver="liblinear")
      print("Logistic regression fitting started")
      lr.fit(train_data, train_labels)
  
      print("generate QMF scores")
      test_scores = lr.predict_proba(test_data)
      print(test_scores[:10], test_labels[:10])
      print(test_scores.shape)
      test_scores = test_scores[:, 1]
  
      with open(args[6]) as f:
          test_lines = f.readlines()
      test_lines = [line.strip().split(" ")[0] for line in test_lines]
      with open(out_dir, "w", buffering=100) as f:
          for line, s, l in zip(test_lines, test_scores, test_labels):
              f.write(f"{line} {s} {l}\n")
  
file_path: espnet/egs2/speechcommands/asr1/pyscripts/utils/spk_apply_qmf_func.py
imports: import os
  import sys
  import numpy
  import soundfile
  from sklearn.linear_model import LogisticRegression
label_desc: Use image node_id 3 for calling a global function with example usage: main(args) without return types