code: def test_locmin_max():
      from mahotas.morph import locmax, locmin
  
      np.random.seed(123)
      for i in range(8):
          A = np.random.random_sample((64, 64))
          A *= 255
          if (i % 2) == 0:
              A = A.astype(np.uint8)
          fast = locmax(A)
          assert np.all(fast == slow_reg(A, max))
  
          fast = locmin(A)
          assert np.all(fast == slow_reg(A, min))
  
imports: import mahotas
  import numpy
  from mahotas.morph import get_structuring_elem, subm, tophat_open, tophat_close
  import pytest
label_desc: Use image node_id 5 for calling a global function with example usage: test_locmin_max() without return types