human
Complete this python program:
def _keys_match(attribute):
assistant
#Here is the Python code you requested.

    """Create an invariant for a ``field`` holding a ``pmap``.
    The invariant enforced is that the keys of the ``pmap`` equal the value of
    a particular attribute of the corresponding values.
    :param str attribute: The name of the attribute of the ``pmap`` values
    which must equal the corresponding key.
    :return: A function suitable for use as a pyrsistent invariant.
    """
    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