def get_external_user_uuid_list(messages):
    """Compiles a list of all unique the external user (respondent) uuids from a list of messages"""
    external_user_uuids = set()

    external_msgs = [message for message in messages if message['from_internal'] is False]
    for message in external_msgs:
        external_user_uuids.add(message["msg_from"])

    internal_messages = [message for message in messages if message['from_internal'] is True]
    for uuid in internal_messages:
        external_user_uuids.add(uuid["msg_to"][0])

    return external_user_uuids