MCPcopy Index your code
hub / github.com/python/cpython / LZMACompressor

Class LZMACompressor

Lib/zipfile/__init__.py:751–771  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

749
750
751class LZMACompressor:
752
753 def __init__(self):
754 self._comp = None
755
756 def _init(self):
757 props = lzma._encode_filter_properties({'id': lzma.FILTER_LZMA1})
758 self._comp = lzma.LZMACompressor(lzma.FORMAT_RAW, filters=[
759 lzma._decode_filter_properties(lzma.FILTER_LZMA1, props)
760 ])
761 return struct.pack('<BBH', 9, 4, len(props)) + props
762
763 def compress(self, data):
764 if self._comp is None:
765 return self._init() + self._comp.compress(data)
766 return self._comp.compress(data)
767
768 def flush(self):
769 if self._comp is None:
770 return self._init() + self._comp.flush()
771 return self._comp.flush()
772
773
774class LZMADecompressor:

Callers 14

__init__Method · 0.85
compressFunction · 0.85
test_simple_bad_argsMethod · 0.85
test_bad_filter_specMethod · 0.85
test_roundtrip_xzMethod · 0.85
test_roundtrip_aloneMethod · 0.85
test_roundtrip_rawMethod · 0.85
test_roundtrip_chunksMethod · 0.85
test_pickleMethod · 0.85

Calls

no outgoing calls

Tested by 11

test_simple_bad_argsMethod · 0.68
test_bad_filter_specMethod · 0.68
test_roundtrip_xzMethod · 0.68
test_roundtrip_aloneMethod · 0.68
test_roundtrip_rawMethod · 0.68
test_roundtrip_chunksMethod · 0.68
test_pickleMethod · 0.68
test_compressorMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…