code: def test_euler_instability():
      # Test for numerical errors in mat2euler
      # problems arise for cos(y) near 0
      po2 = pi / 2
      zyx = po2, po2, po2
      M = nea.euler2mat(*zyx)
      # Round trip
      M_back = nea.euler2mat(*nea.mat2euler(M))
      assert np.allclose(M, M_back)
      # disturb matrix slightly
      M_e = M - FLOAT_EPS
      # round trip to test - OK
      M_e_back = nea.euler2mat(*nea.mat2euler(M_e))
      assert np.allclose(M_e, M_e_back)
      # not so with crude routine
      M_e_back = nea.euler2mat(*crude_mat2euler(M_e))
      assert not np.allclose(M_e, M_e_back)
  
file_path: nibabel/nibabel/tests/test_euler.py
imports: import math
  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 11 for calling a global function with example usage: test_euler_instability() without return types