code: def test_compensation_identity():
      """Test compensation identity."""
      raw = read_raw_fif(ctf_comp_fname)
      assert get_current_comp(raw.info) == 3
      comp1 = make_compensator(raw.info, 3, 1, exclude_comp_chs=False)
      assert comp1.shape == (340, 340)
      comp2 = make_compensator(raw.info, 3, 1, exclude_comp_chs=True)
      assert comp2.shape == (311, 340)
  
      # round-trip
      desired = np.eye(340)
      for from_ in range(3):
          for to in range(3):
              if from_ == to:
                  continue
              comp1 = make_compensator(raw.info, from_, to)
              comp2 = make_compensator(raw.info, to, from_)
              # To get 1e-12 here (instead of 1e-6) we must use the linalg.inv
              # method mentioned in compensator.py
              assert_allclose(np.dot(comp1, comp2), desired, atol=1e-12)
              assert_allclose(np.dot(comp2, comp1), desired, atol=1e-12)
  
file_path: mne-python/mne/_fiff/tests/test_compensator.py
imports: from pathlib import Path
  import numpy
  import pytest
  from numpy.testing import assert_allclose
  from mne import Epochs, pick_types, read_evokeds
  from mne._fiff.compensator import get_current_comp, make_compensator
  from mne.io import read_raw_fif
  from mne.utils import requires_mne, run_subprocess
label_desc: Use image node_id 1 for calling a global function with example usage: test_compensation_identity() without return types