def raw_entities_to_table_data(entities):
    """
    Convert raw entities from a direct API call into table data of the form:
    data = {
        "columns": [
            {"title": "Heading1"},
            {"title": "Heading2"}
        ],
        "data": [
            ["dat1", "dat2"],
            ["dat3", "dat4"]
        }
    }
    Where the length of each list in data['data'] must equal to the number of columns

    :param entities: Response object containing entities from a direct API call
    :param return: Dictionary of data parsable by the UI Table Componenent
    """
    # pylint: disable=redefined-outer-name
    data = {
        "columns": [
            {"title": "id"},
            {"title": "name"},
            {"title": "type"},
        ],
        "data": [],
    }

    # Iterate through each entity
    for entity in entities:
        data["data"].append([entity.get_id(), entity.name, entity.get_type()])

    return data