

def transform_first_chunk(self, status_code, headers, chunk, finishing):
    if ('Vary' in headers):
        headers['Vary'] += b', Accept-Encoding'
    else:
        headers['Vary'] = b'Accept-Encoding'
    if self._gzipping:
        ctype = _unicode(headers.get('Content-Type', '')).split(';')[0]
        chunk._gzipping = (self._compressible_type(ctype) and ((not finishing) or (len(chunk) >= self.MIN_LENGTH)) and ('Content-Encoding' not in headers))
    if self._gzipping:
        headers['Content-Encoding'] = 'gzip'
        self._gzip_value = BytesIO()
        self._gzip_file = gzip.GzipFile(mode='w', fileobj=self._gzip_value)
        chunk = self.transform_chunk(chunk, finishing)
        if ('Content-Length' in headers):
            if finishing:
                headers['Content-Length'] = str(len(chunk))
            else:
                del headers['Content-Length']
    return (status_code, headers, chunk)

dataset/ETHPy150Open RobotWebTools/rosbridge_suite/rosbridge_server/src/tornado/web.py GZipContentEncoding.transform_first_chunk/VarMisuse@76/112 `self`->`chunk`