code: def stream_decode_gzip(iterator):
      
      try:
          dec = zlib.decompressobj(16 + zlib.MAX_WBITS)
          for chunk in iterator:
              rv = dec.decompress(chunk)
              if rv:
                  yield rv
          buf = dec.decompress('')
          rv = buf + dec.flush()
          if rv:
              yield rv
      except zlib.error:
          pass
docs: Stream decodes a gzip-encoded iterator