MCPcopy Create free account
hub / github.com/anthropics/anthropic-sdk-python / decompress

Function decompress

scripts/utils/check-dist.py:115–122  ·  view source on GitHub ↗

`None` unless `data` is one whole stream

(data: bytes, wbits: int)

Source from the content-addressed store, hash-verified

113
114
115def decompress(data: bytes, wbits: int) -> bytes | None:
116 """`None` unless `data` is one whole stream"""
117 stream = zlib.decompressobj(wbits)
118 try:
119 result = stream.decompress(data)
120 except zlib.error:
121 return None
122 return result if stream.eof and not stream.unused_data else None
123
124
125def read_wheel(path: Path) -> list[Member]:

Callers 2

read_wheelFunction · 0.85
read_sdistFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected