<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def update_key_bundle(key_bundle, diff):
 """ Apply a diff specification to a KeyBundle. The keys that are to be added are added. The keys that should be deleted are marked as inactive. :param key_bundle: The original KeyBundle :param diff: The difference specification :return: An updated key_bundle """

    try:
        _add = diff['add']
    except KeyError:
        pass
    else:
        key_bundle.extend(_add)

    try:
        _del = diff['del']
    except KeyError:
        pass
    else:
        _now = time.time()
        for k in _del:
            k.inactive_since = _now