MCPcopy Create free account
hub / github.com/cdgriffith/Box / _to_msgpack

Function _to_msgpack

box/converters.py:321–327  ·  view source on GitHub ↗
(obj, filename: str | PathLike | None = None, **kwargs)

Source from the content-addressed store, hash-verified

319
320
321def _to_msgpack(obj, filename: str | PathLike | None = None, **kwargs):
322 if filename:
323 _exists(filename, create=True)
324 with open(filename, "wb") as f:
325 msgpack.pack(obj, f, **kwargs)
326 else:
327 return msgpack.packb(obj, **kwargs)
328
329
330def _from_msgpack(msgpack_bytes: bytes | None = None, filename: str | PathLike | None = None, **kwargs):

Callers 3

test_to_msgpackMethod · 0.90
to_msgpackMethod · 0.90
to_msgpackMethod · 0.90

Calls 1

_existsFunction · 0.85

Tested by 1

test_to_msgpackMethod · 0.72