code: def _stop_sm(self):
          
          if not self.sm_enabled:
              raise RuntimeError("Stream Management is not enabled")
  
          self._logger.info("stopping SM stream")
          self._sm_enabled = False
          del self._sm_outbound_base
          del self._sm_inbound_ctr
          self._clear_unacked(StanzaState.SENT_WITHOUT_SM)
          del self._sm_unacked_list
  
          self._destroy_stream_state(ConnectionError(
              "stream management disabled"
          ))
docs: Version of :meth:`stop_sm` which can be called during startup.