parameters: (*, name, maxRetries=5, objectService, writerFactory)
docstring: Download the named object from the object service, using a writer returned
      from `writerFactory` to write the data.  The `maxRetries` parameter has
      the same meaning as for service clients.  The `objectService` parameter is
      an instance of the Object class, configured with credentials for the
      download.  Returns the content-type.
docstring_summary: Download the named object from the object service, using a writer returned
      from `writerFactory` to write the data.  The `maxRetries` parameter has
      the same meaning as for service clients.  The `objectService` parameter is
      an instance of the Object class, configured with credentials for the
      download.  Returns the content-type.
docstring_tokens: Download the named object from the object service using a writer returned from writerFactory to write the data . The maxRetries parameter has the same meaning as for service clients . The objectService parameter is an instance of the Object class configured with credentials for the download . Returns the content - type .
function: async def download(*, name, maxRetries=5, objectService, writerFactory):
      """
      Download the named object from the object service, using a writer returned
      from `writerFactory` to write the data.  The `maxRetries` parameter has
      the same meaning as for service clients.  The `objectService` parameter is
      an instance of the Object class, configured with credentials for the
      download.  Returns the content-type.
      """
      async with aiohttp.ClientSession() as session:
          downloadResp = await ensureCoro(objectService.startDownload)(name, {
              "acceptDownloadMethods": {
                  "simple": True,
              },
          })
  
          method = downloadResp["method"]
  
          if method == "simple":
              async def tryDownload(retryFor):
                  with _maybeRetryHttpRequest(retryFor):
                      writer = await writerFactory()
                      url = downloadResp['url']
                      return await _doSimpleDownload(url, writer, session)
  
              return await retry(maxRetries, tryDownload)
          else:
              raise RuntimeError(f'Unknown download method {method}')
function_tokens: async def download ( * , name , maxRetries = 5 , objectService , writerFactory ) : async with aiohttp . ClientSession ( ) as session : downloadResp = await ensureCoro ( objectService . startDownload ) ( name , { "acceptDownloadMethods" : { "simple" : True , } , } ) method = downloadResp [ "method" ] if method == "simple" : async def tryDownload ( retryFor ) : with _maybeRetryHttpRequest ( retryFor ) : writer = await writerFactory ( ) url = downloadResp [ 'url' ] return await _doSimpleDownload ( url , writer , session ) return await retry ( maxRetries , tryDownload ) else : raise RuntimeError ( f'Unknown download method {method}' )