code: def make_workspace(measurement, labels=None, image=None):
      object_set = cellprofiler_core.object.ObjectSet()
      module = (
          cellprofiler.modules.displaydataonimage.DisplayDataOnImage()
      )
      module.set_module_num(1)
      module.image_name.value = INPUT_IMAGE_NAME
      module.display_image.value = OUTPUT_IMAGE_NAME
      module.objects_name.value = OBJECTS_NAME
      m = cellprofiler_core.measurement.Measurements()
  
      if labels is None:
          module.objects_or_image.value = (
              cellprofiler.modules.displaydataonimage.OI_IMAGE
          )
          m.add_image_measurement(MEASUREMENT_NAME, measurement)
          if image is None:
              image = numpy.zeros((50, 120))
      else:
          module.objects_or_image.value = (
              cellprofiler.modules.displaydataonimage.OI_OBJECTS
          )
          o = cellprofiler_core.object.Objects()
          o.segmented = labels
          object_set.add_objects(o, OBJECTS_NAME)
          m.add_measurement(
              OBJECTS_NAME, MEASUREMENT_NAME, numpy.array(measurement)
          )
          y, x = centrosome.cpmorphology.centers_of_labels(labels)
          m.add_measurement(OBJECTS_NAME, "Location_Center_X", x)
          m.add_measurement(OBJECTS_NAME, "Location_Center_Y", y)
          if image is None:
              image = numpy.zeros(labels.shape)
      module.measurement.value = MEASUREMENT_NAME
  
      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)
      image_set.add(
          INPUT_IMAGE_NAME, cellprofiler_core.image.Image(image)
      )
  
      workspace = cellprofiler_core.workspace.Workspace(
          pipeline, module, image_set, object_set, m, image_set_list
      )
      return workspace, module
  
imports: import centrosome.cpmorphology
  import numpy
  import pytest
  import six.moves
  import cellprofiler_core.image
  import cellprofiler_core.measurement
  import cellprofiler.modules.displaydataonimage
  import cellprofiler_core.object
  import cellprofiler_core.pipeline
  import cellprofiler_core.workspace
  import tests.frontend.modules
label_desc: Use image node_id 4 for calling a global function with example usage: make_workspace(measurement, labels, image) and returns: workspace,  module