code: def test_threshold_robust_background_mode_sd_volume():
      numpy.random.seed(73)
  
      data = numpy.random.rand(10, 10, 10)
  
      workspace, module = make_workspace(data, dimensions=3)
  
      image = workspace.image_set.get_image(INPUT_IMAGE_NAME)
  
      module.threshold_scope.value = (
          cellprofiler.modules.threshold.TS_GLOBAL
      )
  
      module.global_operation.value = (
          cellprofiler.modules.threshold.TM_ROBUST_BACKGROUND
      )
  
      module.averaging_method.value = (
          cellprofiler.modules.threshold.RB_MODE
      )
  
      module.variance_method.value = (
          cellprofiler.modules.threshold.RB_SD
      )
  
      t_local, t_global, _, _, _ = module.get_threshold(
          image, workspace
      )
  
      (
          t_local_expected,
          t_global_expected,
          _,
          _,
          _,
      ) = cellprofiler_library.modules.threshold(
          data,
          threshold_method="robust_background",
          threshold_scope="global",
          averaging_method="mode",
          variance_method="standard_deviation",
      )
  
      numpy.testing.assert_almost_equal(t_local, t_local_expected)
  
      numpy.testing.assert_almost_equal(t_global, t_global_expected)
  
imports: import io
  import centrosome.filter
  import centrosome.otsu
  import centrosome.threshold
  import numpy
  import numpy.testing
  import skimage.filters
  import skimage.filters.rank
  import skimage.morphology
  import cellprofiler.modules.threshold
  import cellprofiler_core.image
  import cellprofiler_core.measurement
  import cellprofiler_core.module
  import cellprofiler_core.object
  import cellprofiler_core.pipeline
  import cellprofiler_core.preferences
  import cellprofiler_core.workspace
  from cellprofiler_core.constants.measurement import FF_ORIG_THRESHOLD
  from cellprofiler_core.constants.module._identify import TS_GLOBAL
  import cellprofiler_library.modules
  import cellprofiler_library.functions
  import tests.frontend.modules
label_desc: Use image node_id 31 for calling a global function with example usage: test_threshold_robust_background_mode_sd_volume() without return types