code: def test_rawctf_clean_names():
      """Test RawCTF _clean_names method."""
      # read test data
      with pytest.warns(
          RuntimeWarning, match="ref channel RMSP did not"
      ):
          raw = read_raw_ctf(op.join(ctf_dir, ctf_fname_catch))
          raw_cleaned = read_raw_ctf(
              op.join(ctf_dir, ctf_fname_catch), clean_names=True
          )
      test_channel_names = _clean_names(raw.ch_names)
      test_info_comps = copy.deepcopy(raw.info["comps"])
  
      # channel names should not be cleaned by default
      assert raw.ch_names != test_channel_names
  
      chs_ch_names = [ch["ch_name"] for ch in raw.info["chs"]]
  
      assert chs_ch_names != test_channel_names
  
      for test_comp, comp in zip(test_info_comps, raw.info["comps"]):
          for key in ("row_names", "col_names"):
              assert not array_equal(
                  _clean_names(test_comp["data"][key]),
                  comp["data"][key],
              )
  
      # channel names should be cleaned if clean_names=True
      assert raw_cleaned.ch_names == test_channel_names
  
      for ch, test_ch_name in zip(
          raw_cleaned.info["chs"], test_channel_names
      ):
          assert ch["ch_name"] == test_ch_name
  
      for test_comp, comp in zip(
          test_info_comps, raw_cleaned.info["comps"]
      ):
          for key in ("row_names", "col_names"):
              assert (
                  _clean_names(test_comp["data"][key])
                  == comp["data"][key]
              )
  
imports: import copy
  import os
  import shutil
  from datetime import datetime, timezone
  from os import path
  import numpy
  import pytest
  from numpy import array_equal
  from numpy.testing import assert_allclose, assert_array_equal
  import mne
  import mne.io.ctf.info
  from mne import create_info, events_from_annotations, make_forward_solution, pick_types, read_annotations
  from mne._fiff.compensator import get_current_comp
  from mne._fiff.constants import FIFF
  from mne._fiff.pick import _picks_to_idx
  from mne.datasets import brainstorm, spm_face, testing
  from mne.io import RawArray, read_raw_ctf, read_raw_fif
  from mne.io.ctf.constants import CTF
  from mne.io.ctf.info import _convert_time
  from mne.io.tests.test_raw import _test_raw_reader
  from mne.tests.test_annotations import _assert_annotations_equal
  from mne.transforms import apply_trans
  from mne.utils import _clean_names, _record_warnings, _stamp_to_dt, catch_logging
label_desc: Use image node_id 2 for calling a global function with example usage: test_rawctf_clean_names() without return types