code: def generate_data(utt2dur, scores, embed_dic):
      data = []
      labels = []
      for line in scores:
          utts, score, lab = line.strip().split(" ")
          utt1, utt2 = utts.split("*")
          data_cur = []
  
          # add score
          data_cur.append(float(score))
          labels.append(int(lab))
  
          # add durations
          data_cur.append(np.log(sf.info(utt2dur[utt1]).duration))
          data_cur.append(np.log(sf.info(utt2dur[utt2]).duration))
  
          # add embedding norms
          embed1 = embed_dic[utt1]
          embed2 = embed_dic[utt2]
          l1norms = np.mean(np.linalg.norm(embed1, ord=1, axis=1))
          data_cur.append(l1norms)
          l1norms = np.mean(np.linalg.norm(embed2, ord=1, axis=1))
          data_cur.append(l1norms)
          l2norms = np.mean(np.linalg.norm(embed1, ord=2, axis=1))
          data_cur.append(l2norms)
          l2norms = np.mean(np.linalg.norm(embed2, ord=2, axis=1))
          data_cur.append(l2norms)
  
          # add std as proposed in The ID R&D VoxCeleb Speaker Recognition
          # Challenge 2023 System Description
          std = np.std(np.mean(embed1, axis=0))
          data_cur.append(std)
          std = np.std(np.mean(embed2, axis=0))
          data_cur.append(std)
          std2 = list(np.std(embed1, axis=0))
          data_cur.extend(std2)
          std2 = list(np.std(embed2, axis=0))
          data_cur.extend(std2)
  
          data.append(data_cur)
      data = np.array(data, dtype=np.float32)
      labels = np.array(labels, dtype=np.int32)
      print(f"data shape: {data.shape}")
      print(f"labels shape: {labels.shape}")
      return data, labels
  
file_path: espnet/egs2/voxblink/spk1/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 1 for calling a global function with example usage: generate_data(utt2dur, scores, embed_dic) and returns: data,  labels