code: def ensure_stopped(self):
          
          if not self.active:
              return self
          self.stop()
          self.observer.cancel()
          self._manager.remove_routes(self, self.get_routing_keys())
          self._active = False
          return self
docs: Idempotent channel stop