def format_output(self, data, headers, format_name=None,<EOL>preprocessors=(), column_types=None, **kwargs):
format_name = format_name or self._format_name<EOL>if format_name not in self.supported_formats:<EOL><INDENT>raise ValueError('<STR_LIT>'.format(format_name))<EOL><DEDENT>(_, _preprocessors, formatter,<EOL>fkwargs) = self._output_formats[format_name]<EOL>fkwargs.update(kwargs)<EOL>if column_types is None:<EOL><INDENT>data = list(data)<EOL>column_types = self._get_column_types(data)<EOL><DEDENT>for f in unique_items(preprocessors + _preprocessors):<EOL><INDENT>data, headers = f(data, headers, column_types=column_types,<EOL>**fkwargs)<EOL><DEDENT>return formatter(list(data), headers, column_types=column_types, **fkwargs)<EOL>
Format the headers and data using a specific formatter.

        *format_name* must be a supported formatter (see
        :attr:`supported_formats`).

        :param iterable data: An :term:`iterable` (e.g. list) of rows.
        :param iterable headers: The column headers.
        :param str format_name: The display format to use (optional, if the
            :class:`TabularOutputFormatter` object has a default format set).
        :param tuple preprocessors: Additional preprocessors to call before
                                    any formatter preprocessors.
        :param \*\*kwargs: Optional arguments for the formatter.
        :return: The formatted data.
        :rtype: str
        :raises ValueError: If the *format_name* is not recognized.