<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def insert_column(self, index, header, column):
 """Insert a column before `index` in the table. If length of column is bigger than number of rows, lets say `k`, only the first `k` values of `column` is considered. If column is shorter than 'k', ValueError is raised. Note that Table remains in consistent state even if column is too short. Any changes made by this method is rolled back before raising the exception. Parameters index : int List index rules apply. header : str Title of the column. column : iterable Any iterable of appropriate length. Raises ------ TypeError: If `header` is not of type `str`. ValueError: If length of `column` is shorter than number of rows. """

        if self._column_count == 0:
            self.column_headers = HeaderData(self, [header])
            self._table = [RowData(self, [i]) for i in column]
        else:
            if not isinstance(header, basestring):
                raise TypeError("header must be of type str")
            column_length = 0
            for i, (row, new_item) in enumerate(zip(self._table, column)):
                row._insert(index, new_item)
                column_length = i
            if column_length == len(self._table) - 1:
                self._column_count += 1
                self._column_headers._insert(index, header)
                self._column_alignments._insert(index, self.default_alignment)
                self._column_widths._insert(index, 0)
                self._left_padding_widths._insert(index, self.default_padding)
                self._right_padding_widths._insert(index, self.default_padding)
            else:
                # Roll back changes so that table remains in consistent state
                for j in range(column_length, -1, -1):
                    self._table[j]._pop(index)
                raise ValueError(("length of 'column' should be atleast {}, "
                                  "got {}").format(len(self._table),
                                                   column_length + 1))