(data, compresslevel=9)
return comp.compress(data) + comp.flush()
Compress a block of data.

    compresslevel, if given, must be a number between 1 and 9.

    For incremental compression, use a BZ2Compressor object instead.
Compress a block of data.
Compress a block of data .
def compress(data, compresslevel=9):
    """Compress a block of data.

    compresslevel, if given, must be a number between 1 and 9.

    For incremental compression, use a BZ2Compressor object instead.
    """
    comp = BZ2Compressor(compresslevel)
    return comp.compress(data) + comp.flush()
def compress ( data , compresslevel = 9 ) : comp = BZ2Compressor ( compresslevel ) return comp . compress ( data ) + comp . flush ( )