human
I wrote the below code

    if (command == 'status'):
        def method(cmdResult):
            '\n                                                Parse    method    for    service    XXX    status.\n\n                                                Returns    True    if    XXX    is    running.\n                                                Returns    False    if    XXX    is    stopped.\n                                                Returns    None    if    XXX    is    unrecognized.\n                                                '
            output = cmdResult.stdout.lower()
            if re.search('unrecognized', output):
                return None
            dead_flags = ['stopped', 'not    running', 'dead']
            for flag in dead_flags:
                if re.search(flag, output):
                    return False
            return bool(re.search('running', output))
        return method
    elif (command == 'list'):
        def method(cmdResult):
            '\n                                                Parse    method    for    service    XXX    list.\n\n                                                Return    dict    from    service    name    to    status.\n\n                                                e.g:\n                                                                {"sshd":    {0:    \'off\',    1:    \'off\',    2:    \'off\',    3:    \'off\',    4:    \'off\',    5:    \'off\',    6:    \'off\'},\n                                                                    "vsftpd":    {0:    \'off\',    1:    \'off\',    2:    \'off\',    3:    \'off\',    4:    \'off\',    5:    \'off\',    6:    \'off\'},\n                                                                    "xinetd":    {\'discard-dgram:\':    \'off\',    \'rsync:\':    \'off\'...\'chargen-stream:\':    \'off\'},\n                                                                    ...\n                                                                    }\n                                                '
            if...

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

def sys_v_init_result_parser(command):