code: def make_workspace(pixel_data, mask=None, objects=None, dimensions=2):
      image_set_list = cellprofiler_core.image.ImageSetList()
      image_set = image_set_list.get_image_set(0)
      object_set = cellprofiler_core.object.ObjectSet()
      image = cellprofiler_core.image.Image(
          pixel_data, dimensions=dimensions
      )
      if not mask is None:
          image.mask = mask
      image_set.add(IMAGES_NAME, image)
      if not objects is None:
          o = cellprofiler_core.object.Objects()
          o.segmented = objects
          object_set.add_objects(o, OBJECTS_NAME)
      module = (
          cellprofiler.modules.measureimagequality.MeasureImageQuality()
      )
      module.images_choice.value = (
          cellprofiler.modules.measureimagequality.O_SELECT
      )
      module.image_groups[0].include_image_scalings.value = False
      module.image_groups[0].image_names.value = IMAGES_NAME
      module.image_groups[0].use_all_threshold_methods.value = False
      module.set_module_num(1)
      pipeline = cellprofiler_core.pipeline.Pipeline()
      pipeline.add_module(module)
      workspace = cellprofiler_core.workspace.Workspace(
          pipeline,
          module,
          image_set,
          object_set,
          cellprofiler_core.measurement.Measurements(),
          image_set_list,
      )
      return workspace
  
imports: import io
  import centrosome.threshold
  import numpy
  import cellprofiler_core.image
  import cellprofiler_core.measurement
  from cellprofiler_core.constants.measurement import COLTYPE_FLOAT, EXPERIMENT
  from cellprofiler_core.constants.module._identify import O_FOREGROUND, O_THREE_CLASS, O_WEIGHTED_VARIANCE, O_TWO_CLASS, O_ENTROPY, O_BACKGROUND
  import cellprofiler.modules.measureimagequality
  import cellprofiler_core.modules.namesandtypes
  import cellprofiler.modules.smooth
  import cellprofiler_core.object
  import cellprofiler_core.pipeline
  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(pixel_data, mask, objects, dimensions) and returns: workspace