code: def test_thresholding(method):
      np.random.seed(123)
      A = np.random.rand(128, 128)
      A[24:48, 24:48] += 4 * np.random.rand(24, 24)
      A *= 255 // A.max()
      A = A.astype(np.uint8)
      T = method(A)
      assert (A > T)[24:48, 24:48].mean() > 0.5
      assert (A > T)[:24, :24].mean() < 0.5
      assert (A > T)[48:, :].mean() < 0.5
      assert (A > T)[:, 48:].mean() < 0.5
  
file_path: mahotas/mahotas/tests/test_thresholding.py
imports: import numpy
  from mahotas.thresholding import otsu, rc, bernsen, gbernsen
  from mahotas.histogram import fullhistogram
  import pytest
label_desc: Use image node_id 3 for calling a global function with example usage: test_thresholding(method) without return types