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)
| 710 | |
| 711 | @classmethod |
| 712 | def from_msgpack(cls, msgpack_bytes: bytes | None = None, filename: str | PathLike | None = None, **kwargs): |
| 713 | """ |
| 714 | Transforms a toml string or file into a BoxList object |
| 715 | |
| 716 | :param msgpack_bytes: string to pass to `msgpack.packb` |
| 717 | :param filename: filename to open and pass to `msgpack.pack` |
| 718 | :param kwargs: parameters to pass to `Box()` |
| 719 | :return: |
| 720 | """ |
| 721 | box_args = {} |
| 722 | for arg in list(kwargs.keys()): |
| 723 | if arg in BOX_PARAMETERS: |
| 724 | box_args[arg] = kwargs.pop(arg) |
| 725 | |
| 726 | data = _from_msgpack(msgpack_bytes=msgpack_bytes, filename=filename, **kwargs) |
| 727 | if not isinstance(data, list): |
| 728 | raise BoxError(f"msgpack data not returned as a list but rather a {type(data).__name__}") |
| 729 | return cls(data, **box_args) |
| 730 | |
| 731 | else: |
| 732 |
nothing calls this directly
no test coverage detected