code: def test_interpolation_ecog():
      """Test interpolation for ECoG."""
      raw, epochs_eeg = _load_data("eeg")
      bads = ["EEG 012"]
      bads_mask = np.isin(epochs_eeg.ch_names, bads)
  
      epochs_ecog = epochs_eeg.set_channel_types(
          {ch: "ecog" for ch in epochs_eeg.ch_names}
      )
      epochs_ecog.info["bads"] = bads
  
      # check that interpolation changes the data in raw
      raw_ecog = RawArray(
          data=epochs_ecog._data[0], info=epochs_ecog.info
      )
      raw_before = raw_ecog.copy()
      raw_after = raw_ecog.interpolate_bads(method=dict(ecog="spline"))
      assert not np.all(
          raw_before._data[bads_mask] == raw_after._data[bads_mask]
      )
      assert_array_equal(
          raw_before._data[~bads_mask], raw_after._data[~bads_mask]
      )
  
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 8 for calling a global function with example usage: test_interpolation_ecog() without return types