code: def test_interpolation_nirs():
      """Test interpolating bad nirs channels."""
      pytest.importorskip("pymatreader")
      fname = (
          testing_path
          / "NIRx"
          / "nirscout"
          / "nirx_15_2_recording_w_overlap"
      )
      raw_intensity = read_raw_nirx(fname, preload=False)
      raw_od = optical_density(raw_intensity)
      sci = scalp_coupling_index(raw_od)
      raw_od.info["bads"] = list(compress(raw_od.ch_names, sci < 0.5))
      bad_0 = np.where(
          [name == raw_od.info["bads"][0] for name in raw_od.ch_names]
      )[0][0]
      bad_0_std_pre_interp = np.std(raw_od._data[bad_0])
      bads_init = list(raw_od.info["bads"])
      raw_od.interpolate_bads(exclude=bads_init[:2])
      assert raw_od.info["bads"] == bads_init[:2]
      raw_od.interpolate_bads()
      assert raw_od.info["bads"] == []
      assert bad_0_std_pre_interp > np.std(raw_od._data[bad_0])
      raw_haemo = beer_lambert_law(raw_od, ppf=6)
      raw_haemo.info["bads"] = raw_haemo.ch_names[2:4]
      assert raw_haemo.info["bads"] == ["S1_D2 hbo", "S1_D2 hbr"]
      raw_haemo.interpolate_bads()
      assert raw_haemo.info["bads"] == []
  
imports: from itertools import compress
  from pathlib import Path
  import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_equal
  from mne import Epochs, pick_channels, pick_types, read_events
  from mne._fiff.constants import FIFF
  from mne._fiff.proj import _has_eeg_average_ref_proj
  from mne.channels import make_dig_montage
  from mne.channels.interpolation import _make_interpolation_matrix
  from mne.datasets import testing
  from mne.io import RawArray, read_raw_ctf, read_raw_fif, read_raw_nirx
  from mne.preprocessing.nirs import beer_lambert_law, optical_density, scalp_coupling_index
  from mne.utils import _record_warnings
label_desc: Use image node_id 7 for calling a global function with example usage: test_interpolation_nirs() without return types