code: def make_workspace(ground_truth, test, dimensions=2):
      """Make a workspace with a ground-truth image and a test image
  
      ground_truth and test are dictionaries with the following keys:
      image     - the pixel data
      mask      - (optional) the mask data
      crop_mask - (optional) a cropping mask
  
      returns a workspace and module
      """
      module = (
          cellprofiler.modules.measureimageoverlap.MeasureImageOverlap()
      )
      module.set_module_num(1)
      module.ground_truth.value = GROUND_TRUTH_IMAGE_NAME
      module.test_img.value = TEST_IMAGE_NAME
      module.wants_emd.value = True
  
      pipeline = cellprofiler_core.pipeline.Pipeline()
  
      def callback(caller, event):
          assert not isinstance(
              event, cellprofiler_core.pipeline.event.RunException
          )
  
      pipeline.add_listener(callback)
      pipeline.add_module(module)
  
      image_set_list = cellprofiler_core.image.ImageSetList()
      image_set = image_set_list.get_image_set(0)
  
      for name, d in (
          (GROUND_TRUTH_IMAGE_NAME, ground_truth),
          (TEST_IMAGE_NAME, test),
      ):
          image = cellprofiler_core.image.Image(
              d["image"],
              mask=d.get("mask"),
              crop_mask=d.get("crop_mask"),
              dimensions=dimensions,
          )
          image_set.add(name, image)
  
      workspace = cellprofiler_core.workspace.Workspace(
          pipeline,
          module,
          image_set,
          cellprofiler_core.object.ObjectSet(),
          cellprofiler_core.measurement.Measurements(),
          image_set_list,
      )
      return workspace, module
  
imports: import io
  import numpy
  import numpy.random
  import numpy.testing
  import scipy.ndimage
  import cellprofiler_library.opts.measureimageoverlap
  import cellprofiler_core.image
  import cellprofiler_core.measurement
  import cellprofiler_core.module
  import cellprofiler_core.object
  import cellprofiler_core.pipeline
  import cellprofiler_core.preferences
  import cellprofiler_core.workspace
  from cellprofiler_core.constants.measurement import COLTYPE_FLOAT
  import cellprofiler.modules.measureimageoverlap
  import tests.frontend.modules
label_desc: Use image node_id 4 for calling a global function with example usage: make_workspace(ground_truth, test, dimensions) and returns: workspace,  module