def create_attr_to_username_map(lab_members, attribute):
    """
    Given a dictionary where key is a lab member's username, and the values are
    a dictionary containing their information (see _posts/authors.yml), create
    a dictionary mapping the value of the given attribute to the username.
    """
    return {
        member_info[attribute]: username
        for username, member_info in lab_members.items()
        if attribute in member_info
    }