code: def test_as_euler_degenerate_symmetric_axes():
      # Since we cannot check for angle equality, we check for dcm equality
      angles = np.array(
          [
              [15, 0, 60],
              [35, 0, 75],
              [60, 180, 35],
              [15, -180, 25],
          ]
      )
  
      with pytest.warns(UserWarning, match="Gimbal lock"):
          for axis1 in ["x", "y", "z"]:
              for axis2 in ["x", "y", "z"]:
                  if axis1 == axis2:
                      continue
  
                  # Extrinsic rotations
                  seq = axis1 + axis2 + axis1
                  rotation = Rotation.from_euler(
                      seq, angles, degrees=True
                  )
                  dcm_expected = rotation.as_dcm()
  
                  angle_estimates = rotation.as_euler(seq, degrees=True)
                  dcm_estimated = Rotation.from_euler(
                      seq, angle_estimates, degrees=True
                  ).as_dcm()
  
                  assert_array_almost_equal(dcm_expected, dcm_estimated)
  
                  # Intrinsic rotations
                  seq = seq.upper()
                  rotation = Rotation.from_euler(
                      seq, angles, degrees=True
                  )
                  dcm_expected = rotation.as_dcm()
  
                  angle_estimates = rotation.as_euler(seq, degrees=True)
                  dcm_estimated = Rotation.from_euler(
                      seq, angle_estimates, degrees=True
                  ).as_dcm()
  
                  assert_array_almost_equal(dcm_expected, dcm_estimated)
  
imports: from __future__ import division, print_function, absolute_import
  import pytest
  import numpy
  from numpy.testing import assert_equal, assert_array_almost_equal
  from numpy.testing import assert_allclose
  from scipy.spatial.transform import Rotation, Slerp
  from scipy.stats import special_ortho_group
  from itertools import permutations
label_desc: Use image node_id 38 for calling a global function with example usage: test_as_euler_degenerate_symmetric_axes() without return types