code: def _gzip(self, response):
          
          bytesio = six.BytesIO()
          with gzip.GzipFile(fileobj=bytesio, mode='w') as gz:
              gz.write(response)
          return bytesio.getvalue()
docs: Apply gzip compression to a response.