<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_components(self, requisite=True):
 """ Sets the Components. :param requisite: Set only requisite Components. :type requisite: bool """


        components = self.__components_manager.list_components()
        candidate_components = \
            getattr(set(components), "intersection" if requisite else "difference")(self.__requisite_components)
        deactivated_components = self.__settings.get_key("Settings", "deactivated_components").toString().split(",")
        candidate_components = \
            sorted(filter(lambda x: x not in deactivated_components, candidate_components), key=(components).index)

        for component in candidate_components:
            try:
                profile = self.__components_manager.components[component]
                interface = self.__components_manager.get_interface(component)

                setattr(self,
                        "_{0}__{1}".format(self.__class__.__name__, foundations.namespace.get_leaf(component, ".")),
                        interface)

                self.__splashscreen and self.__splashscreen.show_message(
                    "{0} - {1} | Activating {2}.".format(self.__class__.__name__, Constants.version, component))
                interface.activate(self)
                if profile.category in ("Default", "QObject"):
                    interface.initialize()
                elif profile.category == "QWidget":
                    interface.add_widget()
                    interface.initialize_ui()
            except Exception as error:
                if requisite:
                    message = "'{0}' Component failed to activate!\nException raised: {1}"
                    handler = umbra.reporter.system_exit_exception_handler
                else:
                    message = "'{0}' Component failed to activate, unexpected behavior may occur!\nException raised: {1}"
                    handler = umbra.reporter.base_exception_handler

                exception = manager.exceptions.ComponentActivationError(message.format(component, error))
                handler(exception)