code: def test_01_half_circle():
      """Test the module on a circle and an image that's 1/2 zeros
  
      The measurements here are somewhat considerably off because
      the propagate function uses a Manhattan distance with jaywalking
      allowed instead of the Euclidean distance.
      """
      i, j = numpy.mgrid[-50:51, -50:51]
      labels = (numpy.sqrt(i * i + j * j) <= 40).astype(int)
      image = numpy.zeros(labels.shape)
      image[i > 0] = (numpy.sqrt(i * i + j * j) / 100)[i > 0]
      image[j == 0] = 0
      image[i == j] = 0
      image[i == -j] = 0
      # 1/2 of the octants should be pretty much all zero and 1/2
      # should be all one
      x = [0, 0, 0, 0, 1, 1, 1, 1]
      expected_cv = numpy.std(x) / numpy.mean(x)
      m = run_module(image, labels)
      bin_labels = (numpy.sqrt(i * i + j * j) * 4 / 40.001).astype(int)
      mask = i * i + j * j <= 40 * 40
      total_intensity = numpy.sum(image[mask])
      for bin in range(1, 5):
          data = m.get_current_measurement(
              OBJECT_NAME, feature_frac_at_d(bin, 4)
          )
          assert len(data) == 1
          bin_count = numpy.sum(bin_labels[mask] == bin - 1)
          frac_in_bin = float(bin_count) / numpy.sum(mask)
          bin_intensity = numpy.sum(
              image[mask & (bin_labels == bin - 1)]
          )
          expected = bin_intensity / total_intensity
          assert numpy.abs(expected - data[0]) < 0.2 * expected
          data = m.get_current_measurement(
              OBJECT_NAME, feature_mean_frac(bin, 4)
          )
          assert len(data) == 1
          expected = expected / frac_in_bin
          assert numpy.abs(data[0] - expected) < 0.2 * expected
          data = m.get_current_measurement(
              OBJECT_NAME, feature_radial_cv(bin, 4)
          )
          assert len(data) == 1
          assert numpy.abs(data[0] - expected_cv) < 0.2 * expected_cv
  
imports: import io
  import centrosome.propagate
  import numpy
  import scipy.stats
  import cellprofiler_core.image
  import cellprofiler_core.measurement
  import cellprofiler_core.module
  from cellprofiler_core.constants.measurement import COLTYPE_FLOAT
  import cellprofiler.modules.measureobjectintensitydistribution
  import cellprofiler_core.object
  import cellprofiler_core.pipeline
  import cellprofiler_core.preferences
  import cellprofiler_core.setting
  import cellprofiler_core.workspace
  import tests.frontend.modules
label_desc: Use image node_id 17 for calling a global function with example usage: test_01_half_circle() without return types