def asweek(dt):
    if isinstance(dt, datetime):
        dt = dt.date()
    return dt - timedelta(days=1 - dt.isoweekday())
dataset/ETHPy150Open blaze/blaze/blaze/compute/pydatetime.py/asweek/swapped operands of `-`