code: def get_labels(cid_tid_dict, cid_tids):
      # compute cost matrix between features
      cost_matrix = get_sim_matrix_new(cid_tid_dict, cid_tids)
  
      # cluster all the features
      cluster1 = AgglomerativeClustering(
          n_clusters=None,
          distance_threshold=0.5,
          affinity="precomputed",
          linkage="complete",
      )
      cluster_labels1 = cluster1.fit_predict(cost_matrix)
      labels = get_match(cluster_labels1)
  
      sub_cluster = get_cid_tid(labels, cid_tids)
      return labels
  
imports: from pptracking.python.mot.visualize import plot_tracking
  from python.visualize import visualize_attr
  import os
  import re
  import cv2
  import gc
  import numpy
  import pandas
  from tqdm import tqdm
  from functools import reduce
  import warnings
label_desc: Use image node_id 12 for calling a global function with example usage: get_labels(cid_tid_dict, cid_tids) and returns: labels