code: def test_missing_image():
      numpy.random.seed(0)
      color_image = numpy.random.uniform(size=(10, 20, 3)).astype(
          numpy.float32
      )
      for present in (
          (True, True, False),
          (True, False, True),
          (True, False, False),
          (False, True, True),
          (False, True, False),
          (False, False, True),
      ):
  
          def fn(module):
              assert isinstance(
                  module,
                  cellprofiler.modules.invertforprinting.InvertForPrinting,
              )
              module.input_color_choice.value = (
                  cellprofiler.modules.invertforprinting.CC_GRAYSCALE
              )
              module.output_color_choice.value = (
                  cellprofiler.modules.invertforprinting.CC_GRAYSCALE
              )
  
          d = run_module(
              red_image=color_image[:, :, 0] if present[0] else None,
              green_image=color_image[:, :, 1] if present[1] else None,
              blue_image=color_image[:, :, 2] if present[2] else None,
              fn=fn,
          )
          assert len(d) == 3 + numpy.sum(present)
          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)):
              numpy.testing.assert_almost_equal(
                  result[o],
                  (
                      (1 - color_image[:, :, i1] if present[i1] else 1)
                      * (
                          1 - color_image[:, :, i2]
                          if present[i2]
                          else 1
                      )
                  ),
              )
  
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 6 for calling a global function with example usage: test_missing_image() without return types