code: def duplicate_components(C):
      D = np.diag(1 / np.sqrt(np.diag(C)))
      C = np.matmul(np.matmul(D, C), D)
      components = -np.ones(C.shape[0], dtype=int)
      count = -1
      for i in range(C.shape[0]):
          found_group = False
          for j in range(C.shape[0]):
              if (
                  components[j] < 0
                  and np.abs(2 * C[i, j] - C[i, i] - C[j, j]) < 1e-8
              ):
                  if not found_group:
                      count += 1
                      found_group = True
                  components[j] = count
  
      proj = np.zeros((len(np.unique(components)), C.shape[0]))
      proj[0, 0] = 1
      for i in range(1, C.shape[0]):
          proj[components[i], i] = 1
      return (proj.T / proj.sum(1)).T, proj
  
file_path: shap/shap/explainers/_linear.py
imports: import warnings
  import numpy
  import pandas
  from scipy.sparse import issparse
  from tqdm.auto import tqdm
  from ..None import links, maskers
  from ..utils._exceptions import DimensionError, InvalidFeaturePerturbationError, InvalidModelError
  from ._explainer import Explainer
label_desc: Use image node_id 1 for calling a global function with example usage: duplicate_components(C) and returns: unknown,  proj