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

    if ('env' not in kwargs):
        kwargs['env'] = os.environ
    action = RUN_ACTION(command=command)
    if (handle_stdout is None):
        def handle_stdout(line):
            RUN_OUTPUT_MESSAGE(line=line).write(action=action)
    if (handle_stderr is None):
        def handle_stderr(line):
            RUN_ERROR_MESSAGE(line=line).write(action=action)
    protocol_done = Deferred()
    protocol = CommandProtocol(deferred=protocol_done, handle_stdout=handle_stdout, handle_stderr=handle_stderr)
    with action.context():
        protocol_done = DeferredContext(protocol_done)
        reactor.spawnProcess(protocol, command[0], command, **kwargs)
        def unregister_killer(result, trigger_id):
            try:
                reactor.removeSystemEventTrigger(trigger_id)
            except:
                pass
            return result
        trigger_id = reactor.addSystemEventTrigger('before', 'shutdown', protocol.transport.signalProcess, 'TERM')
        protocol_done.addBoth(unregister_killer, trigger_id)
        return protocol_done.addActionFinish()

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

def run(reactor, command, handle_stdout=None, handle_stderr=None, **kwargs):