def addComponent(self, c, location=''):
        """Adds the component into this container to given location. If
        the location is already populated, the old component is removed.
        If the component is added without specifying the location (empty
        string is then used as location). Only one component can be added
        to the default "" location and adding more components into that
        location overwrites the old components.

        @param c: the component to be added.
        @param location: the location of the component.
        """
        old = self._slots.get(location)
        if old is not None:
            self.removeComponent(old)
        self._slots[location] = c
        c.setParent(self)
        self.fireComponentAttachEvent(c)
        self.requestRepaint()
dataset/ETHPy150Open rwl/muntjac/muntjac/ui/custom_layout.py/CustomLayout.addComponent/original