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

Function get_frame_info

Lib/compression/zstd/__init__.py:61–75  ·  view source on GitHub ↗

Get Zstandard frame information from a frame header. *frame_buffer* is a bytes-like object. It should start from the beginning of a frame, and needs to include at least the frame header (6 to 18 bytes). The returned FrameInfo object has two attributes. 'decompressed_size' is the si

(frame_buffer)

Source from the content-addressed store, hash-verified

59
60
61def get_frame_info(frame_buffer):
62 """Get Zstandard frame information from a frame header.
63
64 *frame_buffer* is a bytes-like object. It should start from the beginning
65 of a frame, and needs to include at least the frame header (6 to 18 bytes).
66
67 The returned FrameInfo object has two attributes.
68 'decompressed_size' is the size in bytes of the data in the frame when
69 decompressed, or None when the decompressed size is unknown.
70 'dictionary_id' is an int in the range (0, 2**32). The special value 0
71 means that the dictionary ID was not recorded in the frame header,
72 the frame may or may not need a dictionary to be decoded,
73 and the ID of such a dictionary is not specified.
74 """
75 return FrameInfo(*_zstd.get_frame_info(frame_buffer))
76
77
78def train_dict(samples, dict_size):

Callers 5

test_get_frame_infoMethod · 0.90
test_as_prefixMethod · 0.90

Calls 1

FrameInfoClass · 0.70

Tested by 5

test_get_frame_infoMethod · 0.72
test_as_prefixMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…