human
I wrote the below code

    def key_match_invariant(pmap):
        if (pmap is None):
            return (True, '')
        for (key, value) in pmap.items():
            if (key != getattr(value, attribute)):
                return (False, '{}    is    not    correct    key    for    {}'.format(key, value))
        return (True, '')
    return key_match_invariant

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

def _keys_match(attribute):