def _items(self, visited, recurse=False, **metadata):
        """Return an iterator that returns a list of tuples of the form
        (rel_pathname, obj) for each trait of this Container that matches
        the given metadata. If recurse is True, also iterate through all
        child Containers of each Container found.
        """
        if id(self) not in visited:
            visited.add(id(self))
            match_dict = self._alltraits(**metadata)

            if recurse:
                for name in self.list_containers():
                    obj = getattr(self, name)
                    if name in match_dict and visited not in id(obj):
                        yield(name, obj)
                    if obj:
                        for chname, child in obj._items(visited, recurse,
                                                        **metadata):
                            yield ('.'.join((name, chname)), child)

            for name, trait in match_dict.items():
                obj = getattr(self, name, Missing)
                # In some components with complex loading behavior (like
                # NPSSComponent), we can have a temporary situation during
                # loading where there are traits that don't point to anything,
                # so check for them here and skip them if they don't point to
                # anything.
                if obj is not Missing:
                    if is_instance(obj, (Container, VarTree)) and \
                       id(obj) not in visited:
                        if not recurse:
                            yield (name, obj)
                    elif trait.iotype is not None:
                        yield (name, obj)
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.main/src/openmdao/main/container.py/Container._items/swapped operands of `not in`