code: def main():
      parser = get_parser()
      args = parser.parse_args()
      n_clusters = args.num_clusters
      save_path = osp.join(args.save_dir, f"CLUS{n_clusters}")
      os.makedirs(save_path, exist_ok=True)
  
      feats_list = []
      with open(args.feats_scp, "r") as f_scp:
          for line in f_scp.readlines():
              _, feat_file = line.split()
              feat = np.load(feat_file)
              feats_list.append(feat)
  
          feats = np.concatenate(feats_list)
  
          gc.collect()
  
      print("Computing kmeans")
      kmeans = KMeans(
          n_clusters=n_clusters, random_state=0, n_init=10
      ).fit(feats)
  
      np.save(osp.join(save_path, "centroids"), kmeans.cluster_centers_)
      pickle.dump(
          kmeans, open(f"{save_path}/kmeans_{n_clusters}.pkl", "wb")
      )
      del kmeans
      gc.collect()
  
file_path: espnet/egs2/universal_se_v1/enh1/pyscripts/feats/feats_cluster_cuml.py
imports: import argparse
  import gc
  import os
  import os.path
  import pickle
  import random
  from collections import namedtuple
  import numpy
  import tqdm
  from cuml.cluster import KMeans
label_desc: Use image node_id 2 for calling a global function with example usage: main() without return types