Find all row names and the maximum column widths.

    Args:
        columns (dict): the keys are the column name and the value the max length.

    Returns:
        dict: column names (key) and widths (value).

def calculate_columns(sequence):
    """
    Find all row names and the maximum column widths.

    Args:
        columns (dict): the keys are the column name and the value the max length.

    Returns:
        dict: column names (key) and widths (value).
    """
    columns = {}

    for row in sequence:
        for key in row.keys():
            if key not in columns:
                columns[key] = len(key)

            value_length = len(str(row[key]))
            if value_length > columns[key]:
                columns[key] = value_length

    return columns