def style_output(data, headers, style=None,<EOL>header_token='<STR_LIT>',<EOL>odd_row_token='<STR_LIT>',<EOL>even_row_token='<STR_LIT>', **_):
if style and HAS_PYGMENTS:<EOL><INDENT>formatter = Terminal256Formatter(style=style)<EOL>def style_field(token, field):<EOL><INDENT>"""<STR_LIT>"""<EOL>s = StringIO()<EOL>formatter.format(((token, field),), s)<EOL>return s.getvalue()<EOL><DEDENT>headers = [style_field(header_token, header) for header in headers]<EOL>data = ([style_field(odd_row_token if i % <NUM_LIT:2> else even_row_token, f)<EOL>for f in r] for i, r in enumerate(data, <NUM_LIT:1>))<EOL><DEDENT>return iter(data), headers<EOL>
Style the *data* and *headers* (e.g. bold, italic, and colors)

    .. NOTE::
        This requires the `Pygments <http://pygments.org/>`_ library to
        be installed. You can install it with CLI Helpers as an extra::
            $ pip install cli_helpers[styles]

    Example usage::

        from cli_helpers.tabular_output.preprocessors import style_output
        from pygments.style import Style
        from pygments.token import Token

        class YourStyle(Style):
            default_style = ""
            styles = {
                Token.Output.Header: 'bold #ansired',
                Token.Output.OddRow: 'bg:#eee #111',
                Token.Output.EvenRow: '#0f0'
            }

        headers = ('First Name', 'Last Name')
        data = [['Fred', 'Roberts'], ['George', 'Smith']]

        data, headers = style_output(data, headers, style=YourStyle)

    :param iterable data: An :term:`iterable` (e.g. list) of rows.
    :param iterable headers: The column headers.
    :param str/pygments.style.Style style: A Pygments style. You can `create
        your own styles <http://pygments.org/docs/styles/#creating-own-styles>`_.
    :param str header_token: The token type to be used for the headers.
    :param str odd_row_token: The token type to be used for odd rows.
    :param str even_row_token: The token type to be used for even rows.
    :return: The styled data and headers.
    :rtype: tuple