docs: def _proximity_to_association(proximity):
      """SLH algorithm for increasing orthogonality of a matrix."""
      # pylint:disable=invalid-name
      # I'm afraid that the short names here are just a function of the
      # mathematical nature of the code.
  
      # Special case: zero-size matrix
      if proximity.shape[0] == 0 or proximity.shape[1] == 0:
          return proximity
  
      # Take SVD of proximity matrix
      U, sing_vals, Vh = np.linalg.svd(proximity)
  
      # Count the number of non-zero singular values
      nsv = np.count_nonzero(sing_vals)
  
      # Trim U and Vh to match
      U, Vh = U[:, :nsv], Vh[:nsv, :]
  
      # Compute new matrix as if singular values were unity
      return U.dot(Vh)