#NEWLINE# def check_random_state_property( distfn , args ) : #NEWLINE# #INDENT# rndm = distfn . random_state #NEWLINE# np . random . seed ( 1234 ) #NEWLINE# distfn . random_state = None #NEWLINE# r0 = distfn . rvs ( * args , size = 8 ) #NEWLINE# distfn . random_state = 1234 #NEWLINE# r1 = distfn . rvs ( * args , size = 8 ) #NEWLINE# npt . assert_equal ( r0 , r1 ) #NEWLINE# distfn . random_state = np . random . RandomState ( 1234 ) #NEWLINE# r2 = distfn . rvs ( * args , size = 8 ) #NEWLINE# npt . assert_equal ( r0 , r2 ) #NEWLINE# distfn . random_state = 2 #NEWLINE# orig_state = distfn . random_state . get_state ( ) #NEWLINE# r3 = distfn . rvs ( * args , size = 8 , random_state = np . random . RandomState ( 1234 ) ) #NEWLINE# npt . assert_equal ( r0 , r3 ) #NEWLINE# npt . assert_equal ( distfn . random_state . get_state ( ) , orig_state ) #NEWLINE# distfn . random_state = rndm