code: def main():
      parser = get_parser()
      args = parser.parse_args()
  
      model_file = f"{args.model_path}/kmeans_{args.num_clusters}.pkl"
      kmeans = pickle.load(open(model_file, "rb"))
  
      generator, num = get_iterator(args)
      iterator = generator()
  
      if not osp.exists(args.output_path):
          os.makedirs(args.output_path)
  
      output_cluster = f"{args.output_path}/{args.split}.cluster"
      with open(output_cluster, "w") as oc:
          for (
              feats,
              fname,
          ) in tqdm.tqdm(iterator, total=num):
              clusters = kmeans.predict(feats)
  
              clusters_str = " ".join(str(c) for c in clusters)
              oc.write(f"{fname} {clusters_str}\n")
  
file_path: espnet/egs2/timit/uasr1/pyscripts/feats/feats_apply_cluster_cuml.py
imports: import argparse
  import logging
  import os
  import os.path
  import pickle
  import sys
  import numpy
  import tqdm
  from cuml.cluster import KMeans
label_desc: Use image node_id 3 for calling a global function with example usage: main() without return types