<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def wait_for_stop(self, timeout=None):
 # type: (Optional[int]) -> bool """ Waits for the framework to stop. Does nothing if the framework bundle is not in ACTIVE state. Uses a threading.Condition object :param timeout: The maximum time to wait (in seconds) :return: True if the framework has stopped, False if the timeout raised """

        if self._state != Bundle.ACTIVE:
            # Inactive framework, ignore the call
            return True

        self._fw_stop_event.wait(timeout)

        with self._lock:
            # If the timeout raised, we should be in another state
            return self._state == Bundle.RESOLVED