code: def _assert_trans(actual, desired, dist_tol=0.017, angle_tol=5.0):
      __tracebackhide__ = True
      trans_est = actual[0:3, 3]
      quat_est = rot_to_quat(actual[0:3, 0:3])
      trans = desired[0:3, 3]
      quat = rot_to_quat(desired[0:3, 0:3])
  
      angle = np.rad2deg(_angle_between_quats(quat_est, quat))
      dist = np.linalg.norm(trans - trans_est)
      assert dist <= dist_tol, "%0.3f > %0.3f mm translation" % (
          1000 * dist,
          1000 * dist_tol,
      )
      assert angle <= angle_tol, "%0.3f > %0.3f° rotation" % (
          angle,
          angle_tol,
      )
  
file_path: mne-python/mne/io/artemis123/tests/test_artemis123.py
imports: import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_equal
  from mne import pick_types
  from mne._fiff.constants import FIFF
  from mne.datasets import testing
  from mne.io import read_raw_artemis123
  from mne.io.artemis123.utils import _generate_mne_locs_file, _load_mne_locs
  from mne.io.tests.test_raw import _test_raw_reader
  from mne.transforms import _angle_between_quats, rot_to_quat
label_desc: Use image node_id 1 for calling a global function with example usage: _assert_trans(actual, desired, dist_tol, angle_tol) without return types