code: def test_rgb_rescale():
      numpy.random.seed(0)
      for combination in (
          (True, True, True),
          (True, True, False),
          (True, False, True),
          (True, False, False),
          (False, True, True),
          (False, True, False),
          (False, False, True),
      ):
          adjustments = numpy.random.uniform(size=7)
          images = [
              numpy.random.uniform(size=(10, 15))
              if combination[i]
              else None
              for i in range(3)
          ]
          images += [None] * 4
          workspace, module = make_workspace(
              cellprofiler.modules.graytocolor.SCHEME_RGB,
              images,
              adjustments,
          )
          module.wants_rescale.value = True
          module.run(workspace)
          image = workspace.image_set.get_image(OUTPUT_IMAGE_NAME)
          pixel_data = image.pixel_data
  
          expected = numpy.dstack(
              [
                  image if image is not None else numpy.zeros((10, 15))
                  for image in images[:3]
              ]
          )
          for i in range(3):
              plane = expected[:, :, i]
              if plane.max() > 0:
                  plane = plane / numpy.max(plane)
              plane *= adjustments[i]
              expected[:, :, i] = plane
          assert numpy.all(numpy.abs(expected - pixel_data) <= 0.00001)
  
file_path: CellProfiler/tests/frontend/modules/test_graytocolor.py
imports: import numpy
  import six.moves
  import os
  import cellprofiler_core.image
  import cellprofiler_core.measurement
  import cellprofiler.modules.graytocolor
  import cellprofiler_core.object
  import cellprofiler_core.pipeline
  import cellprofiler_core.workspace
  import tests.frontend.modules
label_desc: Use image node_id 7 for calling a global function with example usage: test_rgb_rescale() without return types