@staticmethod<EOL><INDENT>def _zlib_compress(data, algorithm):<DEDENT>
if algorithm['<STR_LIT>'] == '<STR_LIT>':<EOL><INDENT>encoder = zlib.compressobj(algorithm['<STR_LIT>'], zlib.DEFLATED, -<NUM_LIT:15>)<EOL>compressed = encoder.compress(data)<EOL>compressed += encoder.flush()<EOL>return compressed<EOL><DEDENT>else:<EOL><INDENT>raise Exception('<STR_LIT>'<EOL>% algorithm['<STR_LIT>'])<EOL><DEDENT>
GZIP compress