def test_random_sample_size():
 a = db.from_sequence(range(1000), npartitions=5)
 assert (10 < len(list(a.random_sample(0.1, 42))) < 300)

def test_random_sample_size ( ) : a = db . from_sequence ( range ( 1000 ) , npartitions = 5 ) assert ( 10 < len ( list ( a . random_sample ( 0.1 , 42 ) ) ) < 300 )
number of randomly sampled elements are in the expected range .