code: def test_nan_interpolation(raw):
      """Test 'nan' method for interpolating bads."""
      ch_to_interp = [
          raw.ch_names[1]
      ]  # don't use channel 0 (type is IAS not MEG)
      raw.info["bads"] = ch_to_interp
  
      # test that warning appears for reset_bads = True
      with pytest.warns(
          RuntimeWarning, match="Consider setting reset_bads=False"
      ):
          raw.interpolate_bads(method="nan", reset_bads=True)
  
      # despite warning, interpolation still happened, make sure the channel is NaN
      bad_chs = raw.get_data(ch_to_interp)
      assert np.isnan(bad_chs).all()
  
      # make sure reset_bads=False works as expected
      raw.info["bads"] = ch_to_interp
      raw.interpolate_bads(method="nan", reset_bads=False)
      assert raw.info["bads"] == ch_to_interp
  
      # make sure other channels are untouched
      raw.drop_channels(ch_to_interp)
      good_chs = raw.get_data()
      assert np.isfinite(good_chs).all()
  
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 10 for calling a global function with example usage: test_nan_interpolation(raw) without return types