def to_msgpack(path_or_buf, *args, **kwargs):
global compressor<EOL>compressor = kwargs.pop('<STR_LIT>', None)<EOL>append = kwargs.pop('<STR_LIT>', None)<EOL>if append:<EOL><INDENT>mode = '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>mode = '<STR_LIT:wb>'<EOL><DEDENT>def writer(fh):<EOL><INDENT>for a in args:<EOL><INDENT>fh.write(pack(a, **kwargs))<EOL><DEDENT><DEDENT>path_or_buf = _stringify_path(path_or_buf)<EOL>if isinstance(path_or_buf, str):<EOL><INDENT>with open(path_or_buf, mode) as fh:<EOL><INDENT>writer(fh)<EOL><DEDENT><DEDENT>elif path_or_buf is None:<EOL><INDENT>buf = BytesIO()<EOL>writer(buf)<EOL>return buf.getvalue()<EOL><DEDENT>else:<EOL><INDENT>writer(path_or_buf)<EOL><DEDENT>
msgpack (serialize) object to input file path

THIS IS AN EXPERIMENTAL LIBRARY and the storage format
may not be stable until a future release.

Parameters
----------
path_or_buf : string File path, buffer-like, or None
              if None, return generated string
args : an object or objects to serialize
encoding : encoding for unicode objects
append : boolean whether to append to an existing msgpack
         (default is False)
compress : type of compressor (zlib or blosc), default to None (no
           compression)