def addComponent(self, c):
        if isinstance(c, IComponentContainer):
            # Make sure we're not adding the component
            # inside it's own content
            parent = self
            while parent is not None:
                parent = parent.getParent()
                if parent == c:
                    msg = 'Component cannot be added inside it\'s own content'
                    raise ValueError, msg

        if c.getParent() is not None:
            # If the component already has a parent, try to remove it
            oldParent = c.getParent()
            oldParent.removeComponent(c)

        c.setParent(self)
        self.fireComponentAttachEvent(c)
Generate a cartesian product of input arrays.
dataset/ETHPy150Open rwl/muntjac/muntjac/ui/abstract_component_container.py/AbstractComponentContainer.addComponent--crossover with--dataset/ETHPy150Open pgmpy/pgmpy/pgmpy/utils/mathext.py/cartesian