def _check_covariance_matrix(covariance, covariance_type):
    if (not np.allclose(covariance, covariance.T) or
            np.any(np.less_equal(linalg.eigvalsh(covariance), .0))):
        raise ValueError("'%s covariance' should be symmetric, "
                         "positive-definite" % covariance_type)
Check a covariance matrix is symmetric and positive-definite.
dataset/ETHPy150Open scikit-learn/scikit-learn/sklearn/mixture/gaussian_mixture.py/_check_covariance_matrix