def read_msgpack(path_or_buf, encoding='<STR_LIT:utf-8>', iterator=False, **kwargs):
path_or_buf, _, _, should_close = get_filepath_or_buffer(path_or_buf)<EOL>if iterator:<EOL><INDENT>return Iterator(path_or_buf)<EOL><DEDENT>def read(fh):<EOL><INDENT>unpacked_obj = list(unpack(fh, encoding=encoding, **kwargs))<EOL>if len(unpacked_obj) == <NUM_LIT:1>:<EOL><INDENT>return unpacked_obj[<NUM_LIT:0>]<EOL><DEDENT>if should_close:<EOL><INDENT>try:<EOL><INDENT>path_or_buf.close()<EOL><DEDENT>except IOError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>return unpacked_obj<EOL><DEDENT>if isinstance(path_or_buf, str):<EOL><INDENT>try:<EOL><INDENT>exists = os.path.exists(path_or_buf)<EOL><DEDENT>except (TypeError, ValueError):<EOL><INDENT>exists = False<EOL><DEDENT>if exists:<EOL><INDENT>with open(path_or_buf, '<STR_LIT:rb>') as fh:<EOL><INDENT>return read(fh)<EOL><DEDENT><DEDENT><DEDENT>if isinstance(path_or_buf, bytes):<EOL><INDENT>fh = None<EOL>try:<EOL><INDENT>fh = BytesIO(path_or_buf)<EOL>return read(fh)<EOL><DEDENT>finally:<EOL><INDENT>if fh is not None:<EOL><INDENT>fh.close()<EOL><DEDENT><DEDENT><DEDENT>elif hasattr(path_or_buf, '<STR_LIT>') and callable(path_or_buf.read):<EOL><INDENT>return read(path_or_buf)<EOL><DEDENT>raise ValueError('<STR_LIT>')<EOL>
Load msgpack pandas object from the specified
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, BytesIO like or string
encoding : Encoding for decoding msgpack str type
iterator : boolean, if True, return an iterator to the unpacker
           (default is False)

Returns
-------
obj : same type as object stored in file