code: def test_color_to_bw():
      numpy.random.seed(0)
      color_image = numpy.random.uniform(size=(10, 20, 3)).astype(
          numpy.float32
      )
  
      def fn(module):
          assert isinstance(
              module,
              cellprofiler.modules.invertforprinting.InvertForPrinting,
          )
          module.input_color_choice.value = (
              cellprofiler.modules.invertforprinting.CC_COLOR
          )
          module.output_color_choice.value = (
              cellprofiler.modules.invertforprinting.CC_GRAYSCALE
          )
  
      d = run_module(color_image=color_image, fn=fn)
      assert len(d) == 4
      assert all(
          [
              color in list(d.keys())
              for color in (I_RED_OUT, I_GREEN_OUT, I_BLUE_OUT)
          ]
      )
      result = [d[I_RED_OUT], d[I_GREEN_OUT], d[I_BLUE_OUT]]
      for o, i1, i2 in ((0, 1, 2), (1, 2, 0), (2, 0, 1)):
          diff = result[o] - (
              (1 - color_image[:, :, i1]) * (1 - color_image[:, :, i2])
          )
          assert numpy.all(numpy.abs(diff) <= numpy.finfo(float).eps)
  
file_path: CellProfiler/tests/frontend/modules/test_invertforprinting.py
imports: import numpy
  import cellprofiler_core.image
  import cellprofiler_core.measurement
  import cellprofiler.modules.invertforprinting
  import cellprofiler_core.object
  import cellprofiler_core.pipeline
  import cellprofiler_core.workspace
label_desc: Use image node_id 3 for calling a global function with example usage: test_color_to_bw() without return types