def test_random_sample_random_state():
 a = db.from_sequence(range(50), npartitions=5)
 b = a.random_sample(0.5, 1234)
 c = a.random_sample(0.5, 1234)
 assert (list(b) == list(c))

def test_random_sample_random_state ( ) : a = db . from_sequence ( range ( 50 ) , npartitions = 5 ) b = a . random_sample ( 0.5 , 1234 ) c = a . random_sample ( 0.5 , 1234 ) assert ( list ( b ) == list ( c ) )
sampling with fixed random seed generates identical results .