#NEWLINE# def two_sided_z_test( Z , alpha ) : #NEWLINE# #INDENT# p_value = ( 1 - np . max ( stats . norm . cdf ( Z ) , ( 1 - stats . norm . cdf ( Z ) ) ) ) #NEWLINE# if ( p_value < ( 1 - ( alpha / 2.0 ) ) ) : #NEWLINE# #INDENT# return ( True , alpha ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return ( None , p_value )