@register.filter(name='tsRange')
def tsRange(ts, value):
    """Converts timestamp to range[ts - value TO ts + value] with value in millis."""
    if not value or not ts:
        return ""

    time = int(ts)
    val = int(value)

    return "[%d TO %d]" % (time - val, time + val)
dataset/ETHPy150Open grigorescu/Brownian/Brownian/view/templatetags/es_extras.py/tsRange/original