code: def sympy_euler(z, y, x):
      # The whole matrix formula for z,y,x rotations from Sympy
      cos = math.cos
      sin = math.sin
      # the following copy / pasted from Sympy - see derivations subdirectory
      return [
          [cos(y) * cos(z), -cos(y) * sin(z), sin(y)],
          [
              cos(x) * sin(z) + cos(z) * sin(x) * sin(y),
              cos(x) * cos(z) - sin(x) * sin(y) * sin(z),
              -cos(y) * sin(x),
          ],
          [
              sin(x) * sin(z) - cos(x) * cos(z) * sin(y),
              cos(z) * sin(x) + cos(x) * sin(y) * sin(z),
              cos(x) * cos(y),
          ],
      ]
  
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 4 for calling a global function with example usage: sympy_euler(z, y, x) and returns: list