code: def test_subm():
      np.random.seed(34)
      for j in range(8):
          s = (128, 256)
          a = np.random.randint(0, 255, size=s)
          b = np.random.randint(0, 255, size=s)
          a = a.astype(np.uint8)
          b = b.astype(np.uint8)
          assert np.all(slow_subm_uint8(a, b) == subm(a, b))
  
          a = 257 * np.random.randint(0, 255, size=s)
          b = 257 * np.random.randint(0, 255, size=s)
          a = a.astype(np.uint16)
          b = b.astype(np.uint16)
          assert np.all(slow_subm_uint16(a, b) == subm(a, b))
  
          a2 = 257 * np.random.randint(0, 255, size=s)
          b2 = 257 * np.random.randint(0, 255, size=s)
          a = a.astype(np.int16)
          b = b.astype(np.int16)
          a -= a2
          b -= b2
          assert np.all(slow_subm_int16(a, b) == subm(a, b))
  
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 11 for calling a global function with example usage: test_subm() without return types