code: def test_diagonal():
      b1 = np.matrix([[1, 2], [3, 4]])
      diag_b1 = np.matrix([[1, 4]])
      array_b1 = np.array([1, 4])
  
      assert_equal(b1.diagonal(), diag_b1)
      assert_equal(np.diagonal(b1), array_b1)
      assert_equal(np.diag(b1), array_b1)
  
imports: import numpy
  from numpy.testing import assert_equal
label_desc: Use image node_id 1 for calling a global function with example usage: test_diagonal() without return types