def download_file(self, bucket, key, filename, extra_args=None,<EOL>callback=None):
if not isinstance(filename, six.string_types):<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>subscribers = self._get_subscribers(callback)<EOL>future = self._manager.download(<EOL>bucket, key, filename, extra_args, subscribers)<EOL>try:<EOL><INDENT>future.result()<EOL><DEDENT>except S3TransferRetriesExceededError as e:<EOL><INDENT>raise RetriesExceededError(e.last_exception)<EOL><DEDENT>
Download an S3 object to a file.

        Variants have also been injected into S3 client, Bucket and Object.
        You don't have to use S3Transfer.download_file() directly.

        .. seealso::
            :py:meth:`S3.Client.download_file`
            :py:meth:`S3.Client.download_fileobj`