<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_opacity(self):
 """ Sets the Widget opacity. """


        if self.__vector > 0:
            if self.isHidden():
                self.show()
            if self.opacity <= self.__target_opacity:
                self.opacity += self.__vector
            else:
                self.__timer.stop()
                self.faded_in.emit()
                self.__duration and QTimer.singleShot(self.__duration, self.__fade_out)
        elif self.__vector < 0:
            if self.opacity > 0:
                self.opacity += self.__vector
            else:
                self.__timer.stop()
                self.faded_out.emit()
                self.hide()