def collect_filtered(function, iterable, filtered):
    '\n    Similar to :func:`filter` but collects filtered elements in ``filtered``.\n\n    Args:\n        function (callable): function that returns ``False`` for elements that\n            should be filtered\n        iterable (iterable): iterable to filter\n        filtered (list): list to store filtered elements\n    '
    for el in iterable:
        if function(el):
            (yield el)
        else:
            filtered.append(el)
Similar to :func:`filter` but collects filtered elements in ``filtered``.

Args:
    function (callable): function that returns ``False`` for elements that
        should be filtered
    iterable (iterable): iterable to filter
    filtered (list): list to store filtered elements
def collect_filtered(function, iterable, filtered):
    '\n    Similar to :func:`filter` but collects filtered elements in ``filtered``.\n\n    Args:\n        function (callable): function that returns ``False`` for elements that\n            should be filtered\n        iterable (iterable): iterable to filter\n        filtered (list): list to store filtered elements\n    '
    for el in iterable:
        if function(el):
            (yield el)
        else:
            filtered.append(el)