code: def wait_for_stop(self, timeout=None):
          # type: (Optional[int]) -> bool
          
          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
docs: 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