def get_tableblocks(page):
    """Get all the TableBlocks for a given page.
    TableBlocks can be stored either directly in page's content,
    or in a FullWidthText item. So we must check both.
    """
    try:
        data = page.specific.content.raw_data
    except Exception:
        return []
    tableblocks = list(
        filter(lambda item: item["type"] == "table_block", data)
    )
    full_width_text_items = list(
        filter(lambda item: item["type"] == "full_width_text", data)
    )
    for item in full_width_text_items:
        sub_items = item["value"]
        for sub_item in list(
            filter(lambda i: i["type"] == "table_block", sub_items)
        ):
            tableblocks.append(sub_item)
    return tableblocks