#NEWLINE# def check_kurt_expect( distfn , arg , m , v , k , msg ) : #NEWLINE# #INDENT# if np . isfinite ( k ) : #NEWLINE# #INDENT# m4e = distfn . expect ( ( lambda x : np . power ( ( x - m ) , 4 ) ) , arg ) #NEWLINE# npt . assert_allclose ( m4e , ( ( k + 3.0 ) * np . power ( v , 2 ) ) , atol = 1e-05 , rtol = 1e-05 , err_msg = ( msg + ' - kurtosis' ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# npt . assert_ ( np . isnan ( k ) )