code: def combin_cluster(sub_labels, cid_tids):
      cluster = list()
      for sub_c_to_c in sub_labels:
          if len(cluster) < 1:
              cluster = sub_labels[sub_c_to_c]
              continue
          for c_ts in sub_labels[sub_c_to_c]:
              is_add = False
              for i_c, c_set in enumerate(cluster):
                  if len(set(c_ts) & set(c_set)) > 0:
                      new_list = list(set(c_ts) | set(c_set))
                      cluster[i_c] = new_list
                      is_add = True
                      break
              if not is_add:
                  cluster.append(c_ts)
      labels = list()
      num_tr = 0
      for c_ts in cluster:
          label_list = list()
          for c_t in c_ts:
              label_list.append(cid_tids.index(c_t))
              num_tr += 1
          label_list.sort()
          labels.append(label_list)
      return labels, cluster
  
imports: import os
  import re
  import cv2
  import gc
  import numpy
  import pandas
  from tqdm import tqdm
  import warnings
label_desc: Use image node_id 24 for calling a global function with example usage: combin_cluster(sub_labels, cid_tids) and returns: labels,  cluster