code: def test_disk():
      from mahotas.morph import disk
  
      D2 = disk(2)
      assert D2.shape[0] == D2.shape[1]
      assert D2.shape == (5, 5)
      assert not D2[0, 0]
      assert len(D2.shape) == 2
      D3 = disk(2, 3)
  
      assert np.all(D3[2] == D2)
  
      D3 = disk(4, 3)
      assert len(D3.shape) == 3
      assert D3.shape[0] == D3.shape[1]
      assert D3.shape[0] == D3.shape[2]
  
      # Simple regression
      D = disk(32, 2)
      assert D[32, 2]
  
      # Test negative values
      for dim in [-2, -1, 0]:
          with pytest.raises(ValueError):
              disk(3, dim)
  
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 16 for calling a global function with example usage: test_disk() without return types