<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def Filter(self, function=None):
 """Construct Textable from the rows of which the function returns true. Args: function: A function applied to each row which returns a bool. If function is None, all rows with empty column values are removed. Returns: A new TextTable() Raises: TableError: When an invalid row entry is Append()'d """

    flat = lambda x: x if isinstance(x, str) else ''.join([flat(y) for y in x])
    if function is None:
      function = lambda row: bool(flat(row.values))

    new_table = self.__class__()
    # pylint: disable=protected-access
    new_table._table = [self.header]
    for row in self:
      if function(row) is True:
        new_table.Append(row)
    return new_table