code: def stop(self, container, raise_on_error=True, **kwargs):
          
          try:
              super(DockerClientWrapper, self).stop(container, **kwargs)
          except APIError as e:
              exc_info = sys.exc_info()
              self.push_log("Failed to stop container '%s': %s", logging.ERROR, container, e.explanation)
              if raise_on_error:
                  six.reraise(*exc_info)
docs: Stops a container. For convenience optionally ignores API errors.
  
          :param container: Container name.
          :type container: unicode | str
          :param raise_on_error: Errors on stop and removal may result from Docker volume problems, that may not
            affect further actions. Such errors are always logged, but do not raise an exception if this is set to
            ``True``.
          :type raise_on_error: bool
          :param kwargs: Additional keyword args for :meth:`docker.client.Client.stop`.