code: def gower_normalization(K, out=None):
      
      c = (K.shape[0] - 1) / (K.trace() - K.mean(0).sum())
      if out is None:
          return c * K
  
      copyto(out, K)
      out *= c
docs: Perform Gower normalizion on covariance matrix K.
  
      The rescaled covariance matrix has sample variance of 1.