Transforms a toml string or file into a BoxList object :param msgpack_bytes: string to pass to `msgpack.packb` :param filename: filename to open and pass to `msgpack.pack` :param kwargs: parameters to pass to `Box()` :return:
(cls, msgpack_bytes: bytes | None = None, filename: str | PathLike | None = None, **kwargs)
| 436 | |
| 437 | @classmethod |
| 438 | def from_msgpack(cls, msgpack_bytes: bytes | None = None, filename: str | PathLike | None = None, **kwargs): |
| 439 | """ |
| 440 | Transforms a toml string or file into a BoxList object |
| 441 | |
| 442 | :param msgpack_bytes: string to pass to `msgpack.packb` |
| 443 | :param filename: filename to open and pass to `msgpack.pack` |
| 444 | :param kwargs: parameters to pass to `Box()` |
| 445 | :return: |
| 446 | """ |
| 447 | box_args = {} |
| 448 | for arg in list(kwargs.keys()): |
| 449 | if arg in BOX_PARAMETERS: |
| 450 | box_args[arg] = kwargs.pop(arg) |
| 451 | |
| 452 | data = _from_msgpack(msgpack_bytes=msgpack_bytes, filename=filename, **kwargs) |
| 453 | if not isinstance(data, list): |
| 454 | raise BoxError(f"msgpack data not returned as a list but rather a {type(data).__name__}") |
| 455 | return cls(data, **box_args) |
| 456 | |
| 457 | else: |
| 458 |
nothing calls this directly
no test coverage detected