def test_np_rng():
 rngs = [make_np_rng(rng_or_seed=42, which_method='uniform'), make_np_rng(rng_or_seed=numpy.random.RandomState(42), which_method='uniform'), make_np_rng(default_seed=42), make_np_rng()]
 random_numbers = rngs[0].uniform(size=(100,))
 equals = numpy.ones((100,))
 for rng in rngs[1:]:
  equal = (random_numbers == rng.uniform(size=(100,)))
  equals *= equal
 assert equals.all()

def test_np_rng ( ) : rngs = [ make_np_rng ( rng_or_seed = 42 , which_method = 'uniform' ) , make_np_rng ( rng_or_seed = numpy . random . RandomState ( 42 ) , which_method = 'uniform' ) , make_np_rng ( default_seed = 42 ) , make_np_rng ( ) ] random_numbers = rngs [ 0 ] . uniform ( size = ( 100 , ) ) equals = numpy . ones ( ( 100 , ) ) for rng in rngs [ 1 : ] : equal = ( random_numbers == rng . uniform ( size = ( 100 , ) ) ) equals *= equal assert equals . all ( )
tests that the four possible ways of creating a numpy rng give the same results with the same seed .