code: def test_clean_info_bads():
      """Test cleaning info['bads'] when bad_channels are excluded."""
      raw_file = io_dir / "tests" / "data" / "test_raw.fif"
      raw = read_raw_fif(raw_file)
      _assert_channel_types(raw.info)
  
      # select eeg channels
      picks_eeg = pick_types(raw.info, meg=False, eeg=True)
  
      # select 3 eeg channels as bads
      idx_eeg_bad_ch = picks_eeg[[1, 5, 14]]
      eeg_bad_ch = [raw.info["ch_names"][k] for k in idx_eeg_bad_ch]
  
      # select meg channels
      picks_meg = pick_types(raw.info, meg=True, eeg=False)
  
      # select randomly 3 meg channels as bads
      idx_meg_bad_ch = picks_meg[[0, 15, 34]]
      meg_bad_ch = [raw.info["ch_names"][k] for k in idx_meg_bad_ch]
  
      # simulate the bad channels
      raw.info["bads"] = eeg_bad_ch + meg_bad_ch
  
      # simulate the call to pick_info excluding the bad eeg channels
      info_eeg = pick_info(raw.info, picks_eeg)
  
      # simulate the call to pick_info excluding the bad meg channels
      info_meg = pick_info(raw.info, picks_meg)
  
      assert info_eeg["bads"] == eeg_bad_ch
      assert info_meg["bads"] == meg_bad_ch
  
      info = pick_info(raw.info, picks_meg)
      info._check_consistency()
      with pytest.raises(ValueError, match="do not exist"):
          info["bads"] += ["EEG 053"]
      with pytest.raises(ValueError, match="unique"):
          pick_info(raw.info, [0, 0])
  
imports: from copy import deepcopy
  from pathlib import Path
  import numpy
  import pytest
  from numpy.testing import assert_array_equal
  from mne import Epochs, channel_indices_by_type, channel_type, create_info, make_ad_hoc_cov, pick_channels, pick_channels_cov, pick_channels_regexp, pick_info, pick_types, pick_types_forward, read_forward_solution, rename_channels
  from mne._fiff.constants import FIFF
  from mne._fiff.pick import _DATA_CH_TYPES_SPLIT, _contains_ch_type, _picks_by_type, _picks_to_idx, get_channel_type_constants
  from mne.channels import make_standard_montage
  from mne.datasets import testing
  from mne.io import RawArray, read_info, read_raw_bti, read_raw_fif, read_raw_kit
  from mne.preprocessing import compute_current_source_density
  from mne.utils import assert_object_equal, catch_logging
label_desc: Use image node_id 17 for calling a global function with example usage: test_clean_info_bads() without return types