def random_sample(size=None, dtype=float):
 rs = generator.get_random_state()
 return rs.random_sample(size=size, dtype=dtype)

def random_sample ( size = None , dtype = float ) : rs = generator . get_random_state ( ) return rs . random_sample ( size = size , dtype = dtype )
safe random sample that wont choke if len < count .