code: def download_logdir_archive(self, id, format='zip', exclude_captures=False): # pylint: disable=invalid-name,redefined-builtin
          
          resp = self.service.get(self.base+str(id)+'/logdir/', params={'format': format, 'exclude_captures': exclude_captures}, stream=True)
          b = io.BytesIO()
          stream.stream_response_to_file(resp, path=b)
          resp.close()
          b.seek(0)
          return (b, self.service.filename(resp))
docs: Download logdir archive in tgz or zip format.
  
          :param id: Result ID as an int.
          :param format: (optional) Format to download, must be string `zip` or `tgz`.
          :param exclude_captures: If bool `True`, don't include capture files
          :rtype: tuple `(io.BytesIO, 'filename')`