code: def test_05_mask():
      """Test, masking out one of the background values"""
      #
      # The log of this array is [-4,-3],[-2,-1] and
      # the variance should be (.25*2 + .25 *2)/4 = .25
      img = numpy.array(
          [
              [1.0 / 16.0, 1.0 / 16.0, 1.0 / 8.0],
              [1.0 / 4.0, 1.0 / 4.0, 1.0 / 2.0],
          ]
      )
      mask = numpy.array([[False, True, True], [False, True, True]])
      binary_image = numpy.array(
          [[False, False, False], [True, True, True]]
      )
      output = centrosome.threshold.weighted_variance(
          img, mask, binary_image
      )
      assert round(abs(output - 0.25), 7) == 0
  
imports: import io
  import os
  import centrosome.threshold
  import numpy
  import pytest
  import scipy.ndimage
  import cellprofiler_core.image
  import cellprofiler_core.measurement
  from cellprofiler_core.constants.measurement import FF_COUNT, COLTYPE_INTEGER, FF_FINAL_THRESHOLD, COLTYPE_FLOAT, FF_ORIG_THRESHOLD, M_NUMBER_OBJECT_NUMBER, M_LOCATION_CENTER_X, M_LOCATION_CENTER_Y, M_LOCATION_CENTER_Z, FF_SUM_OF_ENTROPIES, FF_WEIGHTED_VARIANCE
  from cellprofiler_core.constants.module._identify import TS_GLOBAL, TS_ADAPTIVE, O_TWO_CLASS, O_FOREGROUND, O_THREE_CLASS, O_BACKGROUND, RB_MODE, RB_SD, RB_MEAN, RB_MEDIAN, RB_MAD, TS_MANUAL, TS_MEASUREMENT
  from cellprofiler_core.image import VanillaImage
  import cellprofiler.modules.identifyprimaryobjects
  import cellprofiler.modules.threshold
  import cellprofiler_core.object
  import cellprofiler_core.pipeline
  import cellprofiler_core.setting
  import cellprofiler_core.workspace
  import tests.frontend
  import tests.frontend.modules
label_desc: Use image node_id 49 for calling a global function with example usage: test_05_mask() without return types