code: def test_grey_erode():
      from mahotas.tests.pymorph_copy import erode as slow_erode
      from mahotas.tests.pymorph_copy import dilate as slow_dilate
  
      np.random.seed(334)
      for i in range(8):
          f = np.random.random_sample((128, 128))
          f *= 255
          f = f.astype(np.uint8)
          B = (np.random.random_sample((3, 3)) * 255).astype(np.uint8)
          B //= 4
          fast = mahotas.erode(f, B)
          slow = slow_erode(f, B)
          # mahotas & pymorph use different border conventions.
          assert np.all(fast[1:-1, 1:-1] == slow[1:-1, 1:-1])
  
          fast = mahotas.dilate(f, B)
          slow = slow_dilate(f, B)
          # mahotas & pymorph use different border conventions.
          assert np.all(fast[1:-1, 1:-1] == slow[1:-1, 1:-1])
  
file_path: mahotas/mahotas/tests/test_dilate_erode.py
imports: import numpy
  import mahotas
  import mahotas
label_desc: Use image node_id 1 for calling a global function with example usage: test_grey_erode() without return types