code: def _inspect_cell_array(ndarray):
      """Construct lists from cell arrays (loaded as numpy ndarrays), recursing
      into items if they contain mat_struct objects."""
      elem_list = []
      for sub_elem in ndarray:
          if isinstance(sub_elem, mat_struct):
              elem_list.append(_matstruct_to_dict(sub_elem))
          elif _has_struct(sub_elem):
              elem_list.append(_inspect_cell_array(sub_elem))
          else:
              elem_list.append(sub_elem)
      return elem_list
  
imports: import os
  import time
  import sys
  import zlib
  from io import BytesIO
  import warnings
  import numpy
  import scipy.sparse
  from ._byteordercodes import native_code, swapped_code
  from ._miobase import MatFileReader, docfiller, matdims, read_dtype, arr_to_chars, arr_dtype_number, MatWriteError, MatReadError, MatReadWarning
  from ._mio5_utils import VarReader5
  from ._mio5_params import MatlabObject, MatlabFunction, MDTYPES, NP_TO_MTYPES, NP_TO_MXTYPES, miCOMPRESSED, miMATRIX, miINT8, miUTF8, miUINT32, mxCELL_CLASS, mxSTRUCT_CLASS, mxOBJECT_CLASS, mxCHAR_CLASS, mxSPARSE_CLASS, mxDOUBLE_CLASS, mclass_info, mat_struct
  from ._streams import ZlibInputStream
label_desc: Use image node_id 2 for calling a global function with example usage: _inspect_cell_array(ndarray) and returns: elem_list