def remove(self, name):
        """Remove the specified child from this container and remove any
        public trait objects that reference that child. Notify any
        observers.
        """
        if name in '.':
            self.raise_exception(
                'remove does not allow dotted path names like %s' %
                                 name, NameError)
        try:
            obj = getattr(self, name)
        except AttributeError:
            return None

        trait = self.get_trait(name)
        if trait is None:
            delattr(self, name)
        else:
            # for Slot traits, set their value to None but don't remove
            # the trait
            if trait.is_trait_type(Slot):
                try:
                    setattr(self, name, None)
                except TypeError as err:
                    self.raise_exception(str(err), RuntimeError)
            else:
                self.remove_trait(name)

        return obj
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.main/src/openmdao/main/container.py/Container.remove/swapped operands of `in`