code: def make_workspace(image, labels=None, dimensions=2):
      """Make a workspace for testing Threshold"""
      m = cellprofiler_core.measurement.Measurements()
      object_set = cellprofiler_core.object.ObjectSet()
      module = cellprofiler.modules.overlayoutlines.OverlayOutlines()
      module.blank_image.value = False
      module.image_name.value = INPUT_IMAGE_NAME
      module.output_image_name.value = OUTPUT_IMAGE_NAME
  
      objects = cellprofiler_core.object.Objects()
      if len(labels) > 1:
          ijv = numpy.vstack(
              [
                  numpy.column_stack(
                      list(numpy.where(l > 0)) + [l[l > 0]]
                  )
                  for l in labels
              ]
          )
          objects.set_ijv(ijv, shape=labels[0].shape)
      else:
          objects.segmented = labels[0]
      object_set.add_objects(objects, OBJECTS_NAME)
      module.outlines[0].objects_name.value = OBJECTS_NAME
  
      pipeline = cellprofiler_core.pipeline.Pipeline()
      workspace = cellprofiler_core.workspace.Workspace(
          pipeline, module, m, object_set, m, None
      )
      m.add(
          INPUT_IMAGE_NAME,
          cellprofiler_core.image.Image(image, dimensions=dimensions),
      )
      return workspace, module
  
imports: import io
  import numpy
  import numpy.testing
  import skimage.color
  import skimage.segmentation
  import cellprofiler_core.image
  import cellprofiler_core.measurement
  import cellprofiler_core.module
  import cellprofiler.modules.overlayoutlines
  import cellprofiler_core.object
  import cellprofiler_core.pipeline
  import cellprofiler_core.preferences
  import cellprofiler_core.workspace
  import tests.frontend.modules
label_desc: Use image node_id 1 for calling a global function with example usage: make_workspace(image, labels, dimensions) and returns: workspace,  module