code: def test_smooth_to_average():
      """Test smoothing to an average value"""
      numpy.random.seed(0)
      input_image = numpy.random.uniform(size=(10, 10)).astype(
          numpy.float32
      )
      image_name = "InputImage"
      expected_image = numpy.ones((10, 10)) * input_image.mean()
      pipeline = cellprofiler_core.pipeline.Pipeline()
      pipeline.add_listener(error_callback)
      inj_module = cellprofiler_core.modules.injectimage.InjectImage(
          image_name, input_image
      )
      inj_module.set_module_num(1)
      pipeline.add_module(inj_module)
      module = (
          cellprofiler.modules.correctilluminationcalculate.CorrectIlluminationCalculate()
      )
      module.set_module_num(2)
      pipeline.add_module(module)
      module.image_name.value = image_name
      module.illumination_image_name.value = "OutputImage"
      module.intensity_choice.value = (
          cellprofiler.modules.correctilluminationcalculate.IC_REGULAR
      )
      module.each_or_all.value == cellprofiler.modules.correctilluminationcalculate.EA_EACH
      module.smoothing_method.value = (
          cellprofiler.modules.correctilluminationcalculate.SM_TO_AVERAGE
      )
      module.automatic_object_width.value = (
          cellprofiler.modules.correctilluminationcalculate.FI_MANUALLY
      )
      module.size_of_smoothing_filter.value = 10
      module.rescale_option.value = "No"
      module.dilate_objects.value = False
      measurements = cellprofiler_core.measurement.Measurements()
      image_set_list = cellprofiler_core.image.ImageSetList()
      workspace = cellprofiler_core.workspace.Workspace(
          pipeline, None, None, None, measurements, image_set_list
      )
      pipeline.prepare_run(workspace)
      inj_module.prepare_group(workspace, {}, [1])
      module.prepare_group(workspace, {}, [1])
      image_set = image_set_list.get_image_set(0)
      object_set = cellprofiler_core.object.ObjectSet()
      workspace = cellprofiler_core.workspace.Workspace(
          pipeline,
          inj_module,
          image_set,
          object_set,
          measurements,
          image_set_list,
      )
      inj_module.run(workspace)
      module.run(workspace)
      image = image_set.get_image("OutputImage")
      numpy.testing.assert_almost_equal(
          image.pixel_data, expected_image
      )
  
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 13 for calling a global function with example usage: test_smooth_to_average() without return types