'GETs a file from a given homeserver
Args:
destination (str): The remote server to send the HTTP request to.
path (str): The HTTP path to GET.
output_stream (file): File to write the response body to.
args (dict): Optional dictionary used to create the query string.
ignore_backoff (bool): true to ignore the historical backoff data
and try the request anyway.
Returns:
Deferred: resolves with an (int,dict) tuple of the file length and
a dict of the response headers.
Fails with ``HTTPRequestException`` if we get an HTTP response code
>= 300
Fails with ``NotRetryingDestination`` if we are not yet ready
to retry this server.'

@defer.inlineCallbacks
def get_file(self, destination, path, output_stream, args={}, retry_on_dns_fail=True, max_size=None, ignore_backoff=False):

    encoded_args = {}
    for (k, vs) in args.items():
        if isinstance(vs, basestring):
            vs = [vs]
        encoded_args[k] = [v.encode('UTF-8') for v in vs]
    query_bytes = urllib.urlencode(encoded_args, True)
    logger.debug('Query    bytes:    %s    Retry    DNS:    %s', query_bytes, retry_on_dns_fail)
    def body_callback(method, url_bytes, headers_dict):
        self.sign_request(destination, method, url_bytes, headers_dict)
        return None
    response = (yield self._request(destination, 'GET', path, query_bytes=query_bytes, body_callback=body_callback, retry_on_dns_fail=retry_on_dns_fail, ignore_backoff=ignore_backoff))
    headers = dict(response.headers.getAllRawHeaders())
    try:
        with logcontext.PreserveLoggingContext():
            length = (yield _readBodyToFile(response, output_stream, max_size))
    except:
        logger.exception('Failed    to    download    body')
        raise
    defer.returnValue((length, headers))
