code: def format_plate_data_as_array(plate_dict, plate_type):
      """Returns an array shaped like the given plate type with the values from
      plate_dict stored in it.  Wells without data will be set to np.NaN
      plate_dict  -  dict mapping well names to data. eg: d["A01"] --> data
                     data values must be of numerical or string types
      plate_type  - '96' (return 8x12 array) or '384' (return 16x24 array)
      """
      if plate_type == "96":
          plate_shape = (8, 12)
      elif plate_type == "384":
          plate_shape = (16, 24)
      alphabet = "ABCDEFGHIJKLMNOP"
      data = numpy.zeros(plate_shape)
      data[:] = numpy.nan
      display_error = True
      for well, val in list(plate_dict.items()):
          r = alphabet.index(well[0].upper())
          c = int(well[1:]) - 1
          if r >= data.shape[0] or c >= data.shape[1]:
              if display_error:
                  LOGGER.warning(
                      "A well value (%s) does not fit in the given plate type.\n"
                      % well
                  )
                  display_error = False
              continue
          data[r, c] = val
      return data
  
imports: import functools
  import logging
  import os
  import sys
  import numpy
  import wx
  from cellprofiler_core.image import FileImage
  from cellprofiler_core.preferences import reset_cpfigure_position
  from cellprofiler_core.preferences import get_interpolation_mode
  from cellprofiler_core.preferences import IM_NEAREST
  from cellprofiler_core.preferences import IM_BILINEAR
  from cellprofiler_core.preferences import IM_BICUBIC
  from ..None import errordialog
label_desc: Use image node_id 9 for calling a global function with example usage: format_plate_data_as_array(plate_dict, plate_type) and returns: data