def read_msgpack(path_or_buf, encoding='utf-8', iterator=False, **kwargs):
 (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(path_or_buf)
   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')

def read_msgpack ( path_or_buf , encoding = 'utf-8' , iterator = False , ** kwargs ) : ( 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 ( path_or_buf ) 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' )
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 .