def METHOD_NAME(n_rows, low, high, dense):
    if dense:
        return [random.uniform(low, high) for _ in range(n_rows)]
    current = 0
    rows = []
    while current < n_rows:
        value = float(random.randrange(low, high))
        repetitions = min(random.randint(0, 20), n_rows - current)
        rows.extend([value] * repetitions)
        current += repetitions
    return rows