code: def test_forced_location_auto():
      #
      # Automatic diameter
      #
      d = cellprofiler.modules.definegrid.DefineGrid()
      d.ordering.value = cellprofiler.modules.definegrid.NUM_BY_COLUMNS
      diameter = 7
      gridding = d.build_grid_info(15, 25, 1, 1, 25, 45, 2, 2)
      expected = make_rectangular_grid(gridding)
      i, j = numpy.mgrid[0 : expected.shape[0], 0 : expected.shape[1]]
      ispot, jspot = numpy.mgrid[
          0 : gridding.rows, 0 : gridding.columns
      ]
      y_locations = numpy.zeros(numpy.max(gridding.spot_table) + 1, int)
      y_locations[gridding.spot_table.flatten()] = gridding.y_locations[
          ispot.flatten()
      ]
      x_locations = numpy.zeros(numpy.max(gridding.spot_table) + 1, int)
      x_locations[gridding.spot_table.flatten()] = gridding.x_locations[
          jspot.flatten()
      ]
      idist = i - y_locations[expected]
      jdist = j - x_locations[expected]
      expected[
          idist**2 + jdist**2 > (float(diameter + 1) / 2) ** 2
      ] = 0
      #
      # Make a fuzzy mask to account for the diameter being +/- 1
      #
      mask = numpy.ones(expected.shape, bool)
      mask[
          numpy.abs(
              numpy.sqrt(idist**2 + jdist**2)
              - float(diameter + 1) / 2
          )
          <= 1
      ] = False
      #
      # Make a labels matrix that's like the expected one, but
      # is relabeled randomly
      #
      guide_labels = expected.copy()
      numpy.random.seed(0)
      p = numpy.random.permutation(numpy.arange(expected.max() + 1))
      p[p == 0] = p[0]
      p[0] = 0
      guide_labels = p[guide_labels]
      workspace, module = make_workspace(gridding, guide_labels)
      assert isinstance(
          module,
          cellprofiler.modules.identifyobjectsingrid.IdentifyObjectsInGrid,
      )
      module.diameter_choice.value = (
          cellprofiler.modules.identifyobjectsingrid.AM_AUTOMATIC
      )
      module.shape_choice.value = (
          cellprofiler.modules.identifyobjectsingrid.SHAPE_CIRCLE_FORCED
      )
      module.run(workspace)
      labels = workspace.object_set.get_objects(
          OUTPUT_OBJECTS_NAME
      ).segmented
      assert numpy.all(
          labels[mask]
          == expected[0 : labels.shape[0], 0 : labels.shape[1]][mask]
      )
  
file_path: CellProfiler/tests/frontend/modules/test_identifyobjectsingrid.py
imports: import numpy
  import cellprofiler_core.utilities.grid
  import cellprofiler_core.image
  import cellprofiler_core.measurement
  import cellprofiler.modules.definegrid
  import cellprofiler.modules.identifyobjectsingrid
  import cellprofiler_core.object
  import cellprofiler_core.pipeline
  import cellprofiler_core.workspace
label_desc: Use image node_id 4 for calling a global function with example usage: test_forced_location_auto() without return types