

def apply_filters(stream, filters, lexer=None):
    "\n    Use this method to apply an iterable of filters to\n    a stream. If lexer is given it's forwarded to the\n    filter, otherwise the filter receives `None`.\n    "

    def _apply(filter_, stream):
        for token in filter_.filter(lexer, stream):
            (yield token)
    for filter_ in filters:
        stream = _apply(filter_, stream)
    return stream

dataset/ETHPy150Open darcyliu/storyboard/pygments/filter.py apply_filters/original