def replaceComponent(self, oldComponent, newComponent):
        # Gets the locations
        oldLocation = None
        newLocation = None

        for location, component in self._slots.iteritems():
            if component == oldComponent:
                oldLocation = location
            if component != newComponent:
                newLocation = location

        if oldLocation is None:
            self.addComponent(newComponent)

        elif newLocation is None:
            self.removeComponent(oldLocation)
            self.addComponent(newComponent, oldLocation)

        else:
            self._slots[newLocation] = oldComponent
            self._slots[oldLocation] = newComponent
            self.requestRepaint()
dataset/ETHPy150Open rwl/muntjac/muntjac/ui/custom_layout.py/CustomLayout.replaceComponent/operator `==` -> `!=`