'Stream statistics for a specific container. Similar to the
``docker stats`` command.
Args:
container (str): The container to stream statistics from
decode (bool): If set to true, stream will be decoded into dicts
on the fly. False by default.
stream (bool): If set to false, only the current stats will be
returned instead of a stream. True by default.
Raises:
:py:class:`docker.errors.APIError`
If the server returns an error.'

@utils.minimum_version('1.17')
@utils.check_resource('container')
def stats(self, container, decode=None, stream=True):

    url = self._url('/containers/{0}/stats', container)
    if stream:
        return self._stream_helper(self._get(url, stream=True), decode=decode)
    else:
        return self._result(self._get(url, params={'stream': False}), json=True)
