def smoothrange(a=None, b=None, n=10):
    def _multiple(v, round=False):
        e = floor(log(v, 10)) # exponent
        m = pow(10, e)        # magnitude
        f = v / m             # fraction
        if round is True:
            op, x, y, z = lt, 1.5, 3.0, 7.0
        if round is False:
            op, x, y, z = le, 1.0, 2.0, 5.0
        if op(f, x):
            return m * 1
        if op(f, y):
            return m * 2
        if op(f, z):
            return m * 5
        else:
            return m * 10
    if a is None and b is None:
        a, b = 0, 1
    if a is None:
        a, b = 0, b
    if b is None:
        a, b = 0, a
    if a == b:
        yield float(a); raise StopIteration
    r = _multiple(b - a)
    t = _multiple(r / (n - 1), round=True)
    a = floor(a / t) * t
    b =  ceil(b / t) * t
    for i in range(int((b - a) / t) + 1):
        yield a + i * t

#### STATISTICS ####################################################################################

#--- MEAN ------------------------------------------------------------------------------------------
Returns an iterator of approximately n values v1, v2, ... vn,
dataset/ETHPy150Open clips/pattern/pattern/metrics.py/smoothrange