code: def test_last_object_masked():
      # Regression test of issue #1553
      # MeasureColocalization was truncating the measurements
      # if the last had no pixels or all pixels masked.
      #
      r = numpy.random.RandomState()
      r.seed(65)
      image1 = r.uniform(size=(20, 20))
      image2 = r.uniform(size=(20, 20))
      labels = numpy.zeros((20, 20), int)
      labels[3:8, 3:8] = 1
      labels[13:18, 13:18] = 2
      mask = labels != 2
      objects = cellprofiler_core.object.Objects()
      objects.segmented = labels
  
      for mask1, mask2 in ((mask, None), (None, mask), (mask, mask)):
          workspace, module = make_workspace(
              cellprofiler_core.image.Image(image1, mask=mask1),
              cellprofiler_core.image.Image(image2, mask=mask2),
              objects,
          )
          module.run(workspace)
          m = workspace.measurements
          feature = (
              cellprofiler.modules.measurecolocalization.F_CORRELATION_FORMAT
              % (
                  IMAGE1_NAME,
                  IMAGE2_NAME,
              )
          )
          values = m[OBJECTS_NAME, feature]
          assert len(values) == 2
          assert numpy.isnan(values[1])
  
imports: import numpy
  import six.moves
  import cellprofiler_core.image
  import cellprofiler_core.measurement
  from cellprofiler_core.constants.measurement import COLTYPE_FLOAT
  import cellprofiler.modules.measurecolocalization
  import cellprofiler_core.object
  import cellprofiler_core.pipeline
  import cellprofiler_core.workspace
  import tests.frontend.modules
label_desc: Use image node_id 19 for calling a global function with example usage: test_last_object_masked() without return types