code: def test_calculate_head_pos_chpi_on_chpi5_in_one_second_steps():
      """Comparing estimated cHPI positions with MF results (one second)."""
      # Check to make sure our fits match MF decently
      mf_quats = read_head_pos(chpi5_pos_fname)
      raw = read_raw_fif(chpi5_fif_fname, allow_maxshield="yes")
      # the last two seconds contain a maxfilter problem!
      # fiff file timing: 26. to 43. s
      # maxfilter estimates a wrong head position for interval 16: 41.-42. s
      raw = _decimate_chpi(raw.crop(0.0, 10.0).load_data(), decim=8)
      # needs no interpolation, because maxfilter pos files comes with 1 s steps
      py_quats = _calculate_chpi_positions(
          raw,
          t_step_min=1.0,
          t_step_max=1.0,
          t_window=1.0,
          verbose="debug",
      )
      _assert_quats(
          py_quats,
          mf_quats,
          dist_tol=0.002,
          angle_tol=1.2,
          vel_atol=3e-3,
      )
  
imports: from pathlib import Path
  import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_equal, assert_array_less
  from scipy.interpolate import interp1d
  from scipy.spatial.distance import cdist
  from mne import pick_info, pick_types
  from mne._fiff.constants import FIFF
  from mne.chpi import _chpi_locs_to_times_dig, _compute_good_distances, _get_hpi_initial_fit, _setup_ext_proj, compute_chpi_amplitudes, compute_chpi_locs, compute_chpi_snr, compute_head_pos, extract_chpi_locs_ctf, extract_chpi_locs_kit, filter_chpi, get_active_chpi, get_chpi_info, head_pos_to_trans_rot_t, read_head_pos, write_head_pos
  from mne.datasets import testing
  from mne.forward._compute_forward import _MAG_FACTOR
  from mne.io import RawArray, read_info, read_raw_artemis123, read_raw_ctf, read_raw_fif, read_raw_kit
  from mne.simulation import add_chpi
  from mne.transforms import _angle_between_quats, rot_to_quat
  from mne.utils import assert_meg_snr, catch_logging, object_diff, verbose
  from mne.viz import plot_head_positions
label_desc: Use image node_id 13 for calling a global function with example usage: test_calculate_head_pos_chpi_on_chpi5_in_one_second_steps() without return types