code: def remove_single(text_comps, comp_pred_labels):
      assert text_comps.ndim == 2
      assert text_comps.shape[0] == comp_pred_labels.shape[0]
  
      single_flags = np.zeros_like(comp_pred_labels)
      pred_labels = np.unique(comp_pred_labels)
      for label in pred_labels:
          current_label_flag = comp_pred_labels == label
          if np.sum(current_label_flag) == 1:
              single_flags[np.where(current_label_flag)[0][0]] = 1
      keep_ind = [
          i for i in range(len(comp_pred_labels)) if not single_flags[i]
      ]
      filtered_text_comps = text_comps[keep_ind, :]
      filtered_labels = comp_pred_labels[keep_ind]
  
      return filtered_text_comps, filtered_labels
  
imports: import functools
  import operator
  import numpy
  import paddle
  from numpy.linalg import norm
  import cv2
label_desc: Use image node_id 4 for calling a global function with example usage: remove_single(text_comps, comp_pred_labels) and returns: filtered_text_comps,  filtered_labels