<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def download_logdir_archive(self, id, format='zip', exclude_captures=False):
 # pylint: disable=invalid-name,redefined-builtin """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')` """

        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))