def weave_lists(tables, non_tables, text_first):
    """
    Takes a list of tables, non-tables and a boolean indicating which
    should come first and returns a single list of lines.
    """
    new_list = []
    total_blocks = len(tables) + len(non_tables)
    for i in range(total_blocks):
        if text_first:
            new_list.extend(non_tables.pop(0))
            text_first = False
        else:
            new_list.extend(tables.pop(0))
            text_first = True
    return new_list