code: def test_load_v4():
      file = tests.frontend.modules.get_test_resources_directory(
          "measureimagequality/v4.pipeline"
      )
      with open(file, "r") as fd:
          data = fd.read()
  
      pipeline = cellprofiler_core.pipeline.Pipeline()
  
      def callback(caller, event):
          assert not isinstance(
              event, cellprofiler_core.pipeline.event.LoadException
          )
  
      pipeline.add_listener(callback)
      pipeline.load(io.StringIO(data))
      assert len(pipeline.modules()) == 5
      for module in pipeline.modules():
          assert isinstance(
              module,
              cellprofiler.modules.measureimagequality.MeasureImageQuality,
          )
  
      module = pipeline.modules()[0]
      assert len(module.image_groups) == 1
      group = module.image_groups[0]
      assert group.threshold_groups == []
      assert (
          module.images_choice
          == cellprofiler.modules.measureimagequality.O_ALL_LOADED
      )
      assert group.check_blur
      assert group.scale_groups[0].scale == 20
      assert group.check_saturation
      assert group.check_intensity
      assert group.calculate_threshold
      assert group.use_all_threshold_methods
  
      module = pipeline.modules()[1]
      assert len(module.image_groups) == 1
      group = module.image_groups[0]
      assert (
          module.images_choice
          == cellprofiler.modules.measureimagequality.O_SELECT
      )
      assert group.image_names.value_text == "Alpha"
  
      module = pipeline.modules()[2]
      assert len(module.image_groups) == 1
      group = module.image_groups[0]
      assert (
          module.images_choice
          == cellprofiler.modules.measureimagequality.O_SELECT
      )
      assert "Delta" in group.image_names.value
      assert "Beta" in group.image_names.value
      assert len(group.image_names.value) == 2
  
      module = pipeline.modules()[3]
      assert len(module.image_groups) == 2
      group = module.image_groups[0]
      assert (
          module.images_choice
          == cellprofiler.modules.measureimagequality.O_SELECT
      )
      assert group.image_names.value_text == "Delta"
      assert group.check_intensity
      assert not group.use_all_threshold_methods
      thr = group.threshold_groups[0]
      assert thr.threshold_method == centrosome.threshold.TM_OTSU
      assert thr.use_weighted_variance == O_WEIGHTED_VARIANCE
      assert thr.two_class_otsu == O_TWO_CLASS
      group = module.image_groups[1]
      assert group.image_names.value_text == "Epsilon"
  
      module = pipeline.modules()[4]
      assert len(module.image_groups) == 1
      group = module.image_groups[0]
      assert (
          module.images_choice
          == cellprofiler.modules.measureimagequality.O_SELECT
      )
      assert group.image_names.value_text == "Zeta"
      assert not group.use_all_threshold_methods
      thr = group.threshold_groups[0]
      assert thr.threshold_method == centrosome.threshold.TM_OTSU
      assert thr.use_weighted_variance == O_WEIGHTED_VARIANCE
      assert thr.two_class_otsu == O_TWO_CLASS
      thr = group.threshold_groups[1]
      assert thr.threshold_method == centrosome.threshold.TM_OTSU
      assert thr.use_weighted_variance == O_WEIGHTED_VARIANCE
      assert thr.two_class_otsu == O_THREE_CLASS
      assert thr.assign_middle_to_foreground == O_FOREGROUND
  
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 19 for calling a global function with example usage: test_load_v4() without return types