def tail_avg(timeseries):
    try:
        t = (timeseries[-1][1] + timeseries[-2][1] + timeseries[-3][1]) / 3
        return t
    except IndexError:
        return timeseries[-1][1]
This is a utility function used to calculate the average of the last three
dataset/ETHPy150Open etsy/skyline/src/analyzer/algorithms.py/tail_avg