code: def test_filtered():
      """Regression test of issue #310
  
      post_group should add the composite image to the image set
      if CorrectIllumination_Calculate didn't run because the image
      set was filtered.
      """
      r = numpy.random.RandomState()
      r.seed(13)
      i0 = r.uniform(size=(11, 13))
      i1 = r.uniform(size=(11, 13))
      i2 = r.uniform(size=(11, 13))
      workspaces, module = make_workspaces(
          ((i0, None), (i1, None), (i2, None))
      )
      module.each_or_all.value = (
          cellprofiler.modules.correctilluminationcalculate.EA_ALL_ACROSS
      )
      module.smoothing_method.value = (
          cellprofiler.modules.correctilluminationcalculate.SM_TO_AVERAGE
      )
      module.save_average_image.value = True
      module.save_dilated_image.value = True
  
      module.prepare_group(workspaces[0], None, [1, 2, 3])
      assert isinstance(
          module,
          cellprofiler.modules.correctilluminationcalculate.CorrectIlluminationCalculate,
      )
      for workspace in workspaces[:-1]:
          assert isinstance(
              workspace, cellprofiler_core.workspace.Workspace
          )
          module.run(workspace)
      image_set = workspaces[-1].image_set
      assert OUTPUT_IMAGE_NAME not in image_set.names
      assert DILATED_IMAGE_NAME not in image_set.names
      assert AVERAGE_IMAGE_NAME not in image_set.names
      module.post_group(workspaces[-1], None)
      assert OUTPUT_IMAGE_NAME in image_set.names
      assert DILATED_IMAGE_NAME in image_set.names
      assert AVERAGE_IMAGE_NAME in image_set.names
  
imports: import numpy
  import pytest
  from centrosome.bg_compensate import MODE_AUTO, MODE_BRIGHT, MODE_DARK, MODE_GRAY
  from six.moves import StringIO
  import cellprofiler_core.image
  import cellprofiler_core.measurement
  import cellprofiler.modules.correctilluminationcalculate
  import cellprofiler_core.modules.injectimage
  import cellprofiler_core.object
  import cellprofiler_core.pipeline
  import cellprofiler_core.setting
  import cellprofiler_core.workspace
  import tests.frontend.modules
label_desc: Use image node_id 6 for calling a global function with example usage: test_filtered() without return types