code: def _generate_similarity_mat(labels):
      """Internal function to generate similarity matrix.
  
      Parameters
      ----------
      labels : numpy array of shape (n_samples, 1)
  
      Returns
      -------
      sim_mat : numpy array of shape (n_samples, n_samples)
          Similarity matrix. If label_i == label_j, sim_mat[i,j] = 1, else 0.
  
      """
      l_mat = np.repeat(labels, len(labels), axis=1)
      l_mat_t = l_mat.T
  
      sim_mat = np.equal(l_mat, l_mat_t).astype(int)
      return sim_mat
  
file_path: combo/combo/models/cluster_eac.py
imports: import warnings
  import numpy
  from scipy.cluster.hierarchy import fcluster
  from scipy.cluster.hierarchy import linkage
  from sklearn.utils import check_array
  from sklearn.utils.validation import check_is_fitted
  from pyod.utils.utility import check_parameter
  from .base import BaseAggregator
label_desc: Use image node_id 1 for calling a global function with example usage: _generate_similarity_mat(labels) and returns: sim_mat