def extract_results_from_ldap_data(data):
    """
    LDAP returns a list of 2-element lists::

      data := [[unused, attrs], [unused, attrs], ..]

    attrs is a dictionary mapping:

    ``attribute names -> [attribute value, attribute value, ..]``

    In every case used here, there is exactly one value in the list.

    Each attribute value is encoded in utf-8, and must be
    decoded into python-default unicode.

    Example usage::

    result_type, result_data = <boundldapclient>.result(msgid)
    assert result_type == ldap.RES_SEARCH_RESULT
    return extract_results_from_ldap_data(result_data)
    """
    return [{k:v[0].decode('utf-8')
            for k, v in d[1].items()}
            for d in data]