<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def fill_in_table(self, table, worksheet, flags):
        '''
        Fills in any rows with missing right hand side data with empty cells.
        '''
        max_row = 0
        min_row = sys.maxint
        for row in table:
            if len(row) > max_row:
                max_row = len(row)
            if len(row) < min_row:
                min_row = len(row)
        if max_row != min_row:
            for row in table:
                if len(row) < max_row:
                    row.extend([None]*(max_row-len(row)))