MCPcopy Index your code
hub / github.com/RustPython/RustPython / compress

Function compress

Lib/bz2.py:321–329  ·  view source on GitHub ↗

Compress a block of data. compresslevel, if given, must be a number between 1 and 9. For incremental compression, use a BZ2Compressor object instead.

(data, compresslevel=9)

Source from the content-addressed store, hash-verified

319
320
321def compress(data, compresslevel=9):
322 """Compress a block of data.
323
324 compresslevel, if given, must be a number between 1 and 9.
325
326 For incremental compression, use a BZ2Compressor object instead.
327 """
328 comp = BZ2Compressor(compresslevel)
329 return comp.compress(data) + comp.flush()
330
331
332def decompress(data):

Callers

nothing calls this directly

Calls 3

compressMethod · 0.95
flushMethod · 0.95
BZ2CompressorClass · 0.85

Tested by

no test coverage detected