<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def layout(self):
 """ Calculate the widths of the columns to set the table """

                ret = []
                for row in self.rows:
                        if len(row) > len(ret):
                                ret += [0] * (len(row) - len(ret))
                        for n, field in enumerate(row):
                                if field is self.empty_value:
                                        field = ''
                                ret[n] = max(ret[n], len(field))
                return ret