human
Here's a good function header given the following:
I wrote the below code

    if (before and after):
        raise RegisterException(u'You    can    only    give    either    before    or    after    for    a    phase.')
    if ((not before) and (not after)):
        raise RegisterException(u'You    must    specify    either    a    before    or    after    phase.')
    if ((name in task_phases) or (name in _new_phase_queue)):
        raise RegisterException((u'Phase    %s    already    exists.' % name))
    def add_phase(phase_name, before, after):
        if ((before is not None) and (before not in task_phases)):
            return False
        if ((after is not None) and (after not in task_phases)):
            return False
        phase_methods[phase_name] = (u'on_task_' + phase_name)
        if (before is None):
            task_phases.insert((task_phases.index(after) + 1), phase_name)
        if (after is None):
            task_phases.insert(task_phases.index(before), phase_name)
        return True
    if (not add_phase(name, before, after)):
        _new_phase_queue[name] = [before, after]
    for (phase_name, args) in list(_new_phase_queue.items()):
        if add_phase(phase_name, *args):
            del _new_phase_queue[phase_name]

What's a good function header?
assistant
#Here's a good function header.

def register_task_phase(name, before=None, after=None):