

def read_msgpack(path_or_buf, encoding='utf-8', iterator=False, **kwargs):
    '\n    Load msgpack pandas object from the specified\n    file path\n\n    THIS IS AN EXPERIMENTAL LIBRARY and the storage format\n    may not be stable until a future release.\n\n    Parameters\n    ----------\n    path_or_buf : string File path, BytesIO like or string\n    encoding: Encoding for decoding msgpack str type\n    iterator : boolean, if True, return an iterator to the unpacker\n               (default is False)\n\n    Returns\n    -------\n    obj : type of object stored in file\n\n    '
    (path_or_buf, _, _) = get_filepath_or_buffer(path_or_buf)
    if iterator:
        return Iterator(path_or_buf)

    def read(fh):
        l = list(unpack(fh, encoding=encoding, **kwargs))
        if (len(l) == 1):
            return l[0]
        return l
    if isinstance(path_or_buf, compat.string_types):
        try:
            exists = os.path.exists(path_or_buf)
        except (TypeError, ValueError):
            exists = False
        if exists:
            with open(path_or_buf, 'rb') as fh:
                return read(fh)
    if isinstance(path_or_buf, compat.binary_type):
        fh = None
        try:
            fh = compat.BytesIO(encoding)
            return read(fh)
        finally:
            if (fh is not None):
                fh.close()
    if (hasattr(path_or_buf, 'read') and compat.callable(path_or_buf.read)):
        return read(path_or_buf)
    raise ValueError('path_or_buf needs to be a string file path or file-like')

dataset/ETHPy150Open pydata/pandas/pandas/io/packers.py read_msgpack/VarMisuse@191/431 `path_or_buf`->`encoding`