def test_random_sample_prob_range():
 a = db.from_sequence(range(50), npartitions=5)
 with pytest.raises(ValueError):
  a.random_sample((-1))
 with pytest.raises(ValueError):
  a.random_sample(1.1)

def test_random_sample_prob_range ( ) : a = db . from_sequence ( range ( 50 ) , npartitions = 5 ) with pytest . raises ( ValueError ) : a . random_sample ( ( - 1 ) ) with pytest . raises ( ValueError ) : a . random_sample ( 1.1 )
specifying probabilities outside the range [0 .