code: def make_workspace(
      labels, image, mask=None, intensity_image=None, wants_graph=False
  ):
      m = cellprofiler_core.measurement.Measurements()
      image_set_list = cellprofiler_core.image.ImageSetList()
      m.add_measurement(
          "Image",
          GROUP_NUMBER,
          1,
      )
      m.add_measurement(
          "Image",
          GROUP_INDEX,
          1,
      )
      image_set = m
      img = cellprofiler_core.image.Image(image, mask)
      image_set.add(IMAGE_NAME, img)
  
      object_set = cellprofiler_core.object.ObjectSet()
      o = cellprofiler_core.object.Objects()
      o.segmented = labels
      object_set.add_objects(o, OBJECT_NAME)
  
      module = (
          cellprofiler.modules.measureobjectskeleton.MeasureObjectSkeleton()
      )
      module.image_name.value = IMAGE_NAME
      module.seed_objects_name.value = OBJECT_NAME
      if intensity_image is not None:
          img = cellprofiler_core.image.Image(intensity_image)
          image_set.add(INTENSITY_IMAGE_NAME, img)
          module.intensity_image_name.value = INTENSITY_IMAGE_NAME
      if wants_graph:
          module.wants_objskeleton_graph.value = True
          module.directory.dir_choice = (
              cellprofiler_core.preferences.ABSOLUTE_FOLDER_NAME
          )
          module.directory.custom_path = temp_dir
          module.edge_file_name.value = EDGE_FILE
          module.vertex_file_name.value = VERTEX_FILE
      module.set_module_num(1)
  
      pipeline = cellprofiler_core.pipeline.Pipeline()
  
      def callback(caller, event):
          assert not isinstance(
              event, cellprofiler_core.pipeline.event.LoadException
          )
          assert not isinstance(
              event, cellprofiler_core.pipeline.event.RunException
          )
  
      pipeline.add_listener(callback)
      pipeline.add_module(module)
      workspace = cellprofiler_core.workspace.Workspace(
          pipeline, module, image_set, object_set, m, image_set_list
      )
      return workspace, module
  
imports: import os
  import tempfile
  import traceback
  import numpy
  import six.moves
  import cellprofiler_core.image
  import cellprofiler_core.measurement
  from cellprofiler_core.constants.measurement import GROUP_NUMBER, GROUP_INDEX, COLTYPE_FLOAT, COLTYPE_INTEGER
  import cellprofiler.modules.measureobjectskeleton
  import cellprofiler_core.object
  import cellprofiler_core.pipeline
  import cellprofiler_core.preferences
  import cellprofiler_core.setting
  import cellprofiler_core.workspace
  import tests.frontend.modules
label_desc: Use image node_id 3 for calling a global function with example usage: make_workspace(labels, image, mask, intensity_image, wants_graph) and returns: workspace,  module