human
I wrote the below code

    def _check_unit(file):
        logging.info('Checking    socket    unit    {}'.format(file))
        out = subprocess.check_output(['/usr/bin/systemctl', 'show', '--no-pager', os.path.basename(file)], stderr=subprocess.STDOUT, universal_newlines=True)
        user = ''
        group = ''
        mode = ''
        had_unix_socket = False
        for line in out.split('\n'):
            parts = line.split('=')
            if (len(parts) != 2):
                continue
            (k, v) = parts
            if (k == 'SocketUser'):
                user = v
            if (k == 'SocketGroup'):
                group = v
            if (k == 'ListenStream'):
                if v.startswith('/'):
                    had_unix_socket = True
                    assert v.startswith('/run/dcos/'), 'DC/OS    unix    sockets    must    go    in    the    /run/dcos    directory'
            if (k == 'SocketMode'):
                mode = v
        if (not had_unix_socket):
            return
        assert (user == 'root')
        assert (group == 'dcos_adminrouter')
        assert (mode == '0660')
    for file in glob.glob('/etc/systemd/system/dcos-*.socket'):
        _check_unit(file)

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

def test_socket_units():