

def transform_chunk(self, chunk, finishing):
    if self._gzipping:
        self._gzip_file.write(chunk)
        if finishing:
            self._gzip_file.close()
        else:
            self._gzip_file.flush()
        chunk = self._gzip_value.getvalue()
        self._gzip_value.truncate(0)
        self._gzip_value.seek(0)
    return chunk

dataset/ETHPy150Open RobotWebTools/rosbridge_suite/rosbridge_server/src/tornado/web.py GZipContentEncoding.transform_chunk/original