def after(base=_datetime, diff=None):
    _base = parse(base)
    if isinstance(_base, datetime.date):
        _base = midnight(_base)
    result_dict = dp(diff)
    for unit in result_dict:
        _val = result_dict[unit]
        if not _val:
            continue
        if unit == 'years':
            _base = _base.replace(year=(_base.year + _val))
        elif unit == 'months':
            if _base.month + _val <= 12:
                _base = _base.replace(month=_base.month + _val)
            else:
                _month_diff = (_base.month + _val) - 12
                _base = _base.replace(year=_base.year + 1).replace(month=_month_diff)
        elif unit in ['days', 'hours', 'minutes', 'seconds']:
            _base = _base + datetime.timedelta(**{unit: _val})
    return _base
count datetime after diff args
dataset/ETHPy150Open shinux/PyTime/pytime/pytime.py/after