code: def test_FitPolynomial():
      """Test fitting a polynomial to different gradients"""
  
      y, x = (numpy.mgrid[0:20, 0:20]).astype(float) / 20.0
      image_x = x
      image_y = y
      image_x2 = x**2
      image_y2 = y**2
      image_xy = x * y
      for input_image, image_name in (
          (image_x, "XImage"),
          (image_y, "YImage"),
          (image_x2, "X2Image"),
          (image_y2, "Y2Image"),
          (image_xy, "XYImage"),
      ):
          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_FIT_POLYNOMIAL
          )
          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")
          assert numpy.all(
              numpy.abs(image.pixel_data - input_image) < 0.001
          ), ("Failed to fit polynomial to %s" % image_name)
  
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 10 for calling a global function with example usage: test_FitPolynomial() without return types