code: def make_workspace(image, mask=None, dimensions=2):
      """Make a workspace for testing Threshold"""
      module = cellprofiler.modules.threshold.Threshold()
      module.x_name.value = INPUT_IMAGE_NAME
      module.y_name.value = OUTPUT_IMAGE_NAME
      pipeline = cellprofiler_core.pipeline.Pipeline()
      object_set = cellprofiler_core.object.ObjectSet()
      image_set_list = cellprofiler_core.image.ImageSetList()
      image_set = image_set_list.get_image_set(0)
      workspace = cellprofiler_core.workspace.Workspace(
          pipeline,
          module,
          image_set,
          object_set,
          cellprofiler_core.measurement.Measurements(),
          image_set_list,
      )
      image_set.add(
          INPUT_IMAGE_NAME,
          cellprofiler_core.image.Image(image, dimensions=dimensions)
          if mask is None
          else cellprofiler_core.image.Image(
              image, mask, dimensions=dimensions
          ),
      )
      return workspace, module
  
imports: import io
  import centrosome.filter
  import centrosome.otsu
  import centrosome.threshold
  import numpy
  import numpy.testing
  import skimage.filters
  import skimage.filters.rank
  import skimage.morphology
  import cellprofiler.modules.threshold
  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 FF_ORIG_THRESHOLD
  from cellprofiler_core.constants.module._identify import TS_GLOBAL
  import cellprofiler_library.modules
  import cellprofiler_library.functions
  import tests.frontend.modules
label_desc: Use image node_id 1 for calling a global function with example usage: make_workspace(image, mask, dimensions) and returns: workspace,  module