code: def _todict_from_np_struct(data):  # taken from pymatreader.utils
      data_dict = {}
  
      for cur_field_name in data.dtype.names:
          try:
              n_items = len(data[cur_field_name])
              cur_list = []
  
              for idx in np.arange(n_items):
                  cur_value = data[cur_field_name].item(idx)
                  cur_value = _check_for_scipy_mat_struct(cur_value)
                  cur_list.append(cur_value)
  
              data_dict[cur_field_name] = cur_list
          except TypeError:
              cur_value = data[cur_field_name].item(0)
              cur_value = _check_for_scipy_mat_struct(cur_value)
              data_dict[cur_field_name] = cur_value
  
      return data_dict
  
imports: import numpy
  from scipy.io import loadmat
  from ...utils import _import_pymatreader_funcs
label_desc: Use image node_id 1 for calling a global function with example usage: _todict_from_np_struct(data) and returns: data_dict