code: def test_tophat():
      np.random.seed(32)
      for j in range(8):
          s = (128, 256)
          f = np.random.randint(0, 255, size=s)
          f = f.astype(np.uint8)
          g = tophat_close(f)
          assert f.shape == g.shape
  
          g = tophat_open(f)
          assert f.shape == g.shape
  
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 13 for calling a global function with example usage: test_tophat() without return types