code: def test_quat2mat():
      # also tested in roundtrip case below
      M = nq.quat2mat([1, 0, 0, 0])
      assert_array_almost_equal, M, np.eye(3)
      M = nq.quat2mat([3, 0, 0, 0])
      assert_array_almost_equal, M, np.eye(3)
      M = nq.quat2mat([0, 1, 0, 0])
      assert_array_almost_equal, M, np.diag([1, -1, -1])
      M = nq.quat2mat([0, 2, 0, 0])
      assert_array_almost_equal, M, np.diag([1, -1, -1])
      M = nq.quat2mat([0, 0, 0, 0])
      assert_array_almost_equal, M, np.eye(3)
  
imports: import numpy
  import pytest
  from numpy import pi
  from numpy.testing import assert_array_almost_equal, assert_array_equal
  from ..None import eulerangles
  from ..None import quaternions
label_desc: Use image node_id 7 for calling a global function with example usage: test_quat2mat() without return types