code: def test_get_structuring_elem():
      A = np.zeros((10, 10), np.bool_)
      Bc = np.ones((4, 4), dtype=np.bool_)
      Bc[0, 2] = 0
  
      assert np.all(
          get_structuring_elem(A, None)
          == [[0, 1, 0], [1, 1, 1], [0, 1, 0]]
      )
      assert np.all(
          get_structuring_elem(A, 4)
          == [[0, 1, 0], [1, 1, 1], [0, 1, 0]]
      )
      assert np.all(
          get_structuring_elem(A, 4) == get_structuring_elem(A, 1)
      )
      assert np.all(
          get_structuring_elem(A, 8) == get_structuring_elem(A, 2)
      )
      assert np.all(
          get_structuring_elem(A, 8) == np.ones((3, 3), dtype=np.bool_)
      )
      assert np.all(get_structuring_elem(A, Bc) == Bc)
      assert np.all(get_structuring_elem(A, Bc.T) == Bc.T)
      assert get_structuring_elem(A, Bc.T).flags["C_CONTIGUOUS"]
      assert np.all(
          get_structuring_elem(A, Bc.astype(np.float_).T).flags[
              "C_CONTIGUOUS"
          ]
      )
      assert np.all(
          get_structuring_elem(A, Bc.astype(np.float_).T) == Bc.T
      )
  
      with pytest.raises(ValueError):
          Bc = np.ones((3, 3, 3), dtype=np.bool_)
          get_structuring_elem(A, Bc)
  
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 1 for calling a global function with example usage: test_get_structuring_elem() without return types