code: def test_images_to_process():
      #
      # Test MeasureImageQuality.images_to_process on a pipeline with a
      # variety of image providers.
      #
      expected_names = ["foo", "bar"]
      pipeline = cellprofiler_core.pipeline.Pipeline()
      module1 = cellprofiler_core.modules.namesandtypes.NamesAndTypes()
      module1.set_module_num(1)
      module1.assignment_method.value = (
          cellprofiler_core.modules.namesandtypes.ASSIGN_RULES
      )
      module1.add_assignment()
      module1.add_assignment()
      module1.assignments[0].image_name.value = expected_names[0]
      module1.assignments[
          0
      ].load_as_choice.value = (
          cellprofiler_core.modules.namesandtypes.LOAD_AS_GRAYSCALE_IMAGE
      )
      #
      # TO_DO: issue #652
      #    This test should fail at some later date when we can detect
      #    that an illumination function should not be QA measured
      #
      module1.assignments[1].image_name.value = expected_names[1]
      module1.assignments[
          1
      ].load_as_choice.value = (
          cellprofiler_core.modules.namesandtypes.LOAD_AS_ILLUMINATION_FUNCTION
      )
      module1.assignments[
          2
      ].load_as_choice.value = (
          cellprofiler_core.modules.namesandtypes.LOAD_AS_OBJECTS
      )
      pipeline.add_module(module1)
  
      module2 = cellprofiler.modules.smooth.Smooth()
      module2.set_module_num(2)
      module2.image_name.value = expected_names[0]
      module2.filtered_image_name.value = "henry"
      pipeline.add_module(module2)
  
      miq_module = (
          cellprofiler.modules.measureimagequality.MeasureImageQuality()
      )
      miq_module.set_module_num(3)
      miq_module.images_choice.value = (
          cellprofiler.modules.measureimagequality.O_ALL_LOADED
      )
      image_names = miq_module.images_to_process(
          miq_module.image_groups[0], None, pipeline
      )
      assert len(image_names) == len(expected_names)
      for image_name in image_names:
          assert image_name in expected_names
  
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 22 for calling a global function with example usage: test_images_to_process() without return types