def truncate_second(dt, measure):
    """
    Truncate by second

    >>> dt = datetime(2000, 1, 1, 12, 30, 38)
    >>> truncate_second(dt, 15)
    datetime.datetime(2000, 1, 1, 12, 30, 30)
    """
    d = datetime(
        dt.year, dt.month, dt.day, tzinfo=dt.tzinfo)  # local zero for seconds
    seconds = total_seconds(d - dt) // measure * measure
    return dt.utcfromtimestamp(seconds + utctotimestamp(d))
dataset/ETHPy150Open blaze/blaze/blaze/compute/pydatetime.py/truncate_second/swapped operands of `-`