def _sym_quad_form(x, mu, A):
 q = (cdist(x, mu[np.newaxis], 'mahalanobis', VI=A) ** 2).reshape((-1))
 return q

def _sym_quad_form ( x , mu , A ) : q = ( cdist ( x , mu [ np . newaxis ] , 'mahalanobis' , VI = A ) ** 2 ) . reshape ( ( - 1 ) ) return q
helper function to calculate symmetric quadratic form x .