code: def stop(self):
          
  
          try:
              yield from self._clean_servers()
              yield from self._stop_ubridge()
  
              try:
                  state = yield from self._get_container_state()
              except DockerHttp404Error:
                  self.status = "stopped"
                  return
  
              if state == "paused":
                  yield from self.unpause()
  
              yield from self._fix_permissions()
              state = yield from self._get_container_state()
              if state != "stopped" or state != "exited":
                  # t=5 number of seconds to wait before killing the container
                  try:
                      yield from self.manager.query("POST", "containers/{}/stop".format(self._cid), params={"t": 5})
                      log.info("Docker container '{name}' [{image}] stopped".format(
                          name=self._name, image=self._image))
                  except DockerHttp304Error:
                      # Container is already stopped
                      pass
          # Ignore runtime error because when closing the server
          except RuntimeError as e:
              log.debug("Docker runtime error when closing: {}".format(str(e)))
              return
          self.status = "stopped"
docs: Stops this Docker container.