<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_completer(self, completer):
 """ Sets given completer as the current completer. :param completer: Completer. :type completer: QCompleter :return: Method success. :rtype: bool """


        if not issubclass(completer.__class__, QCompleter):
            raise foundations.exceptions.ProgrammingError("{0} | '{1}' is not a 'QCompleter' subclass!".format(
                self.__class__.__name__, completer))

        if self.__completer:
            self.remove_completer()

        LOGGER.debug("> Setting '{0}' completer.".format(completer))
        self.__completer = completer
        self.__completer.setWidget(self)

        # Signals / Slots.
        self.__completer.activated.connect(self.__insert_completion)

        return True