code: def test_check_info_inv():
      """Test checks for common channels across fwd model and cov matrices."""
      epochs, data_cov, noise_cov, forward = _get_data()
  
      # make sure same channel lists exist in data to make testing life easier
      assert epochs.info["ch_names"] == data_cov.ch_names
      assert epochs.info["ch_names"] == noise_cov.ch_names
  
      # check whether bad channels get excluded from the channel selection
      # info
      info_bads = epochs.info.copy()
      info_bads["bads"] = info_bads["ch_names"][
          1:3
      ]  # include two bad channels
      picks = _check_info_inv(info_bads, forward, noise_cov=noise_cov)
      assert [1, 2] not in picks
      # covariance matrix
      data_cov_bads = data_cov.copy()
      data_cov_bads["bads"] = [data_cov_bads.ch_names[0]]
      picks = _check_info_inv(
          epochs.info, forward, data_cov=data_cov_bads
      )
      assert 0 not in picks
      # noise covariance matrix
      noise_cov_bads = noise_cov.copy()
      noise_cov_bads["bads"] = [noise_cov_bads.ch_names[1]]
      picks = _check_info_inv(
          epochs.info, forward, noise_cov=noise_cov_bads
      )
      assert 1 not in picks
  
      # test whether reference channels get deleted
      info_ref = epochs.info.copy()
      info_ref["chs"][0]["kind"] = 301  # pretend to have a ref channel
      picks = _check_info_inv(info_ref, forward, noise_cov=noise_cov)
      assert 0 not in picks
  
      # pick channels in all inputs and make sure common set is returned
      epochs.pick([epochs.ch_names[ii] for ii in range(10)])
      data_cov = pick_channels_cov(
          data_cov,
          include=[data_cov.ch_names[ii] for ii in range(5, 20)],
      )
      noise_cov = pick_channels_cov(
          noise_cov,
          include=[noise_cov.ch_names[ii] for ii in range(7, 12)],
      )
      with catch_logging() as log:
          picks = _check_info_inv(
              epochs.info,
              forward,
              noise_cov=noise_cov,
              data_cov=data_cov,
              verbose=True,
          )
          assert list(range(7, 10)) == picks
  
      # make sure to inform the user that 7 channels were dropped
      # (there are 10 channels in epochs but only 3 were picked)
      log = log.getvalue()
      assert "Excluding 7 channel(s) missing" in log
  
imports: import os
  import sys
  from pathlib import Path
  import numpy
  import pytest
  import mne
  from mne import pick_channels_cov, read_vectorview_selection
  from mne._fiff.pick import _picks_to_idx
  from mne.datasets import testing
  from mne.utils import Bunch, _check_ch_locs, _check_fname, _check_info_inv, _check_option, _check_range, _check_sphere, _check_subject, _on_missing, _path_like, _safe_input, _suggest, _validate_type, catch_logging, check_fname, check_random_state, check_version
label_desc: Use image node_id 4 for calling a global function with example usage: test_check_info_inv() without return types