def make_member_list(members, **attr_map):
    """
    Create a dict representation of a list of members which we can use
    to serialize the members list.  Keyword arguments map the names of
    optional attributes to include to the database attribute.
    """

    def _fetch_memb(memb, attr_map):
        return {k: memb[v] for k, v in attr_map.items() if v in memb.keys()}

    # Return the list of members with the given attribute mapping
    return [_fetch_memb(memb, attr_map) for memb in members]