def _DownloadFile(self, uri, file_path):
        server_response = self.request('GET', uri)
        response_body = server_response.read()
        if server_response.status != 200:
            raise gdata.service.RequestError, {'status': server_response.status,
                                               'reason': server_response.reason,
                                               'body': response_body}
        if googlecl.docs.base.can_export(uri) and\
           self.config.lazy_get(SECTION_HEADER, 'decode_utf_8', False, bool):
            try:
                file_string = response_body.decode('utf-8-sig')
            except UnicodeError, err:
                LOG.debug('Could not decode: ' + str(err))
                file_string = response_body
        else:
            file_string = response_body
        with open(file_path, 'wb') as download_file:
            download_file.write(file_string)
            download_file.flush()
Downloads a file.
dataset/ETHPy150Open vinitkumar/googlecl/src/googlecl/docs/service.py/DocsServiceCL._DownloadFile