<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_entry(entry, status, directives):
    '''Update an entry's attributes using the provided directives

    :param entry:
        A dict mapping each attribute name to a set of its values
    :param status:
        A dict holding cross-invocation status (whether delete_others
        is True or not, and the set of mentioned attributes)
    :param directives:
        A dict mapping directive types to directive-specific state
    '''
    for directive, state in six.iteritems(directives):
        if directive == 'delete_others':
            status['delete_others'] = state
            continue
        for attr, vals in six.iteritems(state):
            status['mentioned_attributes'].add(attr)
            vals = _toset(vals)
            if directive == 'default':
                if vals and (attr not in entry or not entry[attr]):
                    entry[attr] = vals
            elif directive == 'add':
                vals.update(entry.get(attr, ()))
                if vals:
                    entry[attr] = vals
            elif directive == 'delete':
                existing_vals = entry.pop(attr, OrderedSet())
                if vals:
                    existing_vals -= vals
                    if existing_vals:
                        entry[attr] = existing_vals
            elif directive == 'replace':
                entry.pop(attr, None)
                if vals:
                    entry[attr] = vals
            else:
                raise ValueError('unknown directive: ' + directive)