def gower_normalization(K, out=None):
c = (K.shape[<NUM_LIT:0>] - <NUM_LIT:1>) / (K.trace() - K.mean(<NUM_LIT:0>).sum())<EOL>if out is None:<EOL><INDENT>return c * K<EOL><DEDENT>copyto(out, K)<EOL>out *= c<EOL>
Perform Gower normalizion on covariance matrix K.

    The rescaled covariance matrix has sample variance of 1.