def as_text(self, max_rows=<NUM_LIT:0>, sep="<STR_LIT>"):
if not max_rows or max_rows > self.num_rows:<EOL><INDENT>max_rows = self.num_rows<EOL><DEDENT>omitted = max(<NUM_LIT:0>, self.num_rows - max_rows)<EOL>labels = self._columns.keys()<EOL>fmts = self._get_column_formatters(max_rows, False)<EOL>rows = [[fmt(label, label=True) for fmt, label in zip(fmts, labels)]]<EOL>for row in itertools.islice(self.rows, max_rows):<EOL><INDENT>rows.append([f(v, label=False) for v, f in zip(row, fmts)])<EOL><DEDENT>lines = [sep.join(row) for row in rows]<EOL>if omitted:<EOL><INDENT>lines.append('<STR_LIT>'.format(omitted))<EOL><DEDENT>return '<STR_LIT:\n>'.join([line.rstrip() for line in lines])<EOL>
Format table as text.