code: def test_nans():
      # Test for NaN values in two measurements.
      #
      labels = numpy.zeros((10, 15), int)
      labels[3:5, 3:5] = 1
      labels[6:8, 3:5] = 3
      labels[3:5, 6:8] = 4
      labels[6:8, 6:8] = 5
      labels[3:5, 10:12] = 2
  
      m1 = numpy.array((1, 2, numpy.NaN, 1, numpy.NaN))
      m2 = numpy.array((1, 2, 1, numpy.NaN, numpy.NaN))
      for leave_last_out in (False, True):
          end = (
              numpy.max(labels) - 1
              if leave_last_out
              else numpy.max(labels)
          )
          workspace, module = make_workspace(
              labels,
              cellprofiler.modules.classifyobjects.BY_TWO_MEASUREMENTS,
              m1[:end],
              m2[:end],
          )
          assert isinstance(
              module,
              cellprofiler.modules.classifyobjects.ClassifyObjects,
          )
          module.first_threshold_method.value = (
              cellprofiler.modules.classifyobjects.TM_MEAN
          )
          module.first_threshold.value = 2
          module.second_threshold_method.value = (
              cellprofiler.modules.classifyobjects.TM_MEAN
          )
          module.second_threshold.value = 2
          module.wants_image.value = True
          module.wants_custom_names.value = False
          module.run(workspace)
          f_names = (
              "Measurement1_low_Measurement2_low",
              "Measurement1_low_Measurement2_high",
              "Measurement1_high_Measurement2_low",
              "Measurement1_high_Measurement2_high",
          )
          m_names = [
              "_".join(
                  (
                      cellprofiler.modules.classifyobjects.M_CATEGORY,
                      name,
                  )
              )
              for name in f_names
          ]
          m = workspace.measurements
          for m_name, expected in zip(
              m_names,
              [
                  numpy.array((1, 0, 0, 0, 0)),
                  numpy.array((0, 0, 0, 0, 0)),
                  numpy.array((0, 0, 0, 0, 0)),
                  numpy.array((0, 1, 0, 0, 0)),
              ],
          ):
              values = m[OBJECTS_NAME, m_name]
              numpy.testing.assert_array_equal(values, expected)
  
imports: import contextlib
  import os
  import pickle
  import tempfile
  import numpy
  import pytest
  import cellprofiler_core.image
  import cellprofiler_core.measurement
  from cellprofiler_core.constants.measurement import COLTYPE_FLOAT, COLTYPE_INTEGER
  import cellprofiler.modules.classifyobjects
  import cellprofiler_core.object
  import cellprofiler_core.pipeline
  import cellprofiler_core.setting
  import cellprofiler_core.workspace
label_desc: Use image node_id 10 for calling a global function with example usage: test_nans() without return types