code: def test_small_images():
      """Test mixture of gaussians thresholding with few pixels
  
      Run MOG to see if it blows up, given 0-10 pixels"""
      r = numpy.random.RandomState()
      r.seed(91)
      image = r.uniform(size=(9, 11))
      ii, jj = numpy.mgrid[0 : image.shape[0], 0 : image.shape[1]]
      ii, jj = ii.flatten(), jj.flatten()
  
      for threshold_method in (
          cellprofiler.modules.threshold.TM_LI,
          cellprofiler.modules.threshold.TM_OTSU,
          cellprofiler.modules.threshold.TM_ROBUST_BACKGROUND,
      ):
          for i in range(11):
              mask = numpy.zeros(image.shape, bool)
              if i:
                  p = r.permutation(numpy.prod(image.shape))[:i]
                  mask[ii[p], jj[p]] = True
              workspace, x = make_workspace(image, mask)
              x.global_operation.value = threshold_method
              x.threshold_scope.value = TS_GLOBAL
              l, g, _, _, _ = x.get_threshold(
                  cellprofiler_core.image.Image(image, mask=mask),
                  workspace,
              )
              v = image[mask]
              image = r.uniform(size=(9, 11))
              image[mask] = v
              l1, g1, _, _, _ = x.get_threshold(
                  cellprofiler_core.image.Image(image, mask=mask),
                  workspace,
              )
              assert round(abs(l1 - l), 7) == 0
  
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 18 for calling a global function with example usage: test_small_images() without return types