code: def read_file(path, session=None):
      
      try:
          data = loadmat(path, struct_as_record=True)
      except UnicodeDecodeError as e:
          raise Oct2PyError(str(e))
      out = dict()
      for (key, value) in data.items():
          out[key] = _extract(value, session)
      return out
docs: Read the data from the given file path.