human
I wrote the below code

    if (command == 'status'):
        def method(cmdResult):
            '\n                                                Parse    method    for    systemctl    status    XXX.service.\n\n                                                Returns    True    if    XXX.service    is    running.\n                                                Returns    False    if    XXX.service    is    stopped.\n                                                Returns    None    if    XXX.service    is    not    loaded.\n                                                '
            output = cmdResult.stdout
            if (not re.search('Loaded:    loaded', output)):
                return None
            return (output.count('Active:    active') > 0)
        return method
    elif (command == 'list'):
        def method(cmdResult):
            '\n                                                Parse    method    for    systemctl    list    XXX.service.\n\n                                                Return    a    dict    from    service    name    to    status.\n\n                                                e.g:\n                                                                {"sshd":    "enabled",\n                                                                    "vsftpd":    "disabled",\n                                                                    "systemd-sysctl":    "static",\n                                                                    ...\n                                                                    }\n                                                '
            if cmdResult.exit_status:
                raise error.CmdError(cmdResult.command, cmdResult)
            _service2status_dict = {}
            lines = cmdResult.stdout.strip().splitlines()
            for line in lines:
                sublines = line.strip().split()
                if ((not (len(sublines) == 2)) or (not sublines[0].endswith('service'))):
                    continue
                service_name =...

What's a good function header?

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

def systemd_result_parser(command):