code: def test_group_on_one():
      groups = cellprofiler_core.modules.groups.Groups()
      groups, workspace = make_image_sets(
          (
              ("Plate", ("P-12345", "P-23456")),
              ("Well", ("A01", "A02", "A03")),
              ("Site", ("1", "2", "3", "4")),
          ),
          (
              (
                  "DNA",
                  "Wavelength",
                  "1",
                  cellprofiler_core.pipeline.ImageSetChannelDescriptor.CT_GRAYSCALE,
              ),
              (
                  "GFP",
                  "Wavelength",
                  "1",
                  cellprofiler_core.pipeline.ImageSetChannelDescriptor.CT_GRAYSCALE,
              ),
          ),
      )
      groups.wants_groups.value = True
      groups.grouping_metadata[0].metadata_choice.value = "Plate"
      groups.prepare_run(workspace)
      m = workspace.measurements
      assert isinstance(m, cellprofiler_core.measurement.Measurements)
      image_numbers = m.get_image_numbers()
      assert len(image_numbers) == 24
      numpy.testing.assert_array_equal(
          numpy.hstack([numpy.ones(12, int), numpy.ones(12, int) * 2]),
          m[
              cellprofiler_core.constants.measurement.IMAGE,
              cellprofiler_core.constants.measurement.GROUP_NUMBER,
              image_numbers,
          ],
      )
      numpy.testing.assert_array_equal(
          numpy.hstack([numpy.arange(1, 13)] * 2),
          m[
              cellprofiler_core.constants.measurement.IMAGE,
              cellprofiler_core.constants.measurement.GROUP_INDEX,
              image_numbers,
          ],
      )
  
      pipeline = workspace.pipeline
      assert isinstance(pipeline, cellprofiler_core.pipeline.Pipeline)
      key_list, groupings = pipeline.get_groupings(workspace)
      assert len(key_list) == 1
      assert key_list[0] == "Metadata_Plate"
      assert len(groupings) == 2
  
      for group_number, plate, (grouping, image_set_list) in zip(
          (1, 2), ("P-12345", "P-23456"), groupings
      ):
          assert grouping == dict(Metadata_Plate=plate)
          assert len(image_set_list) == 3 * 4
          assert list(image_set_list) == list(
              range((group_number - 1) * 12 + 1, group_number * 12 + 1)
          )
          for image_number in range(
              1 + (group_number - 1) * 12, 1 + group_number * 12
          ):
              for image_name in ("DNA", "GFP"):
                  ftr = "_".join(
                      (
                          cellprofiler_core.constants.measurement.C_FILE_NAME,
                          image_name,
                      )
                  )
                  assert m[
                      cellprofiler_core.constants.measurement.IMAGE,
                      ftr,
                      image_number,
                  ].startswith(plate)
  
file_path: CellProfiler/tests/core/modules/test_groups.py
imports: import io
  import os
  import numpy
  import cellprofiler_core.constants.measurement
  import cellprofiler_core.measurement
  import cellprofiler_core.modules.groups
  import cellprofiler_core.pipeline
  import cellprofiler_core.workspace
  import tests.core
label_desc: Use image node_id 6 for calling a global function with example usage: test_group_on_one() without return types