

def filter(self, filter):
    '\n        Apply filter on this node iterator, and return a new iterator instead.\n        `filter` should be a Filter instance.\n        '
    if (filter is not None):
        assert isinstance(filter, filters.Filter)

        def new_iterator():
            for n in self:
                if filter._filter(n):
                    (yield n)
        return NodeIterator(new_iterator)
    else:
        return self

dataset/ETHPy150Open jonathanslenders/python-deployer/deployer/inspection/inspector.py NodeIterator.filter/original