code: def encapsulate_strings_in_arrays(handles):
      """Recursively descend through the handles structure, replacing strings as arrays packed with strings
  
      This function makes the handles structure loaded through the sandwich compatible with loadmat. It operates on the array in-place.
      """
      if handles.dtype.kind == "O":
          # cells - descend recursively
          flat = handles.flat
          for i in range(0, len(flat)):
              if isinstance(flat[i], str):
                  flat[i] = encapsulate_string(flat[i])
              elif isinstance(flat[i], numpy.ndarray):
                  encapsulate_strings_in_arrays(flat[i])
      elif handles.dtype.fields:
          # A structure: iterate over all structure elements.
          for field in list(handles.dtype.fields.keys()):
              if isinstance(handles[field], str):
                  handles[field] = encapsulate_string(handles[field])
              elif isinstance(handles[field], numpy.ndarray):
                  encapsulate_strings_in_arrays(handles[field])
  
imports: import bisect
  import re
  import numpy
  from ...constants.pipeline import make_cell_struct_dtype
  from ...constants.pipeline import PIPELINE
  from ...constants.pipeline import IMAGE_PLANE_DESCRIPTOR_VERSION
  from ...constants.pipeline import H_PLANE_COUNT
  from ...constants.pipeline import H_URL
  from ...constants.pipeline import H_SERIES
  from ...constants.pipeline import H_INDEX
  from ...constants.pipeline import H_CHANNEL
  from ...constants.pipeline import RF_STATE_PREQUOTE
  from ...constants.pipeline import RF_STATE_FIELD
  from ...constants.pipeline import RF_STATE_BACKSLASH_ESCAPE
  from ...constants.pipeline import RF_STATE_SEPARATOR
  from ..legacy import cmp
label_desc: Use image node_id 8 for calling a global function with example usage: encapsulate_strings_in_arrays(handles) without return types