def filter(self, filter):
        """
        Apply filter on this node iterator, and return a new iterator instead.
        `filter` should be a Filter instance.
        """
        if filter in 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/operator `is not` -> `in`