code: def test_csd_fif():
      """Test applying CSD to FIF data."""
      raw = read_raw_fif(raw_fname).load_data()
      raw.info["bads"] = []
      picks = pick_types(raw.info, meg=False, eeg=True)
      assert "csd" not in raw
      orig_eeg = raw.get_data("eeg")
      assert len(orig_eeg) == 60
      raw_csd = compute_current_source_density(raw)
      assert "eeg" not in raw_csd
      new_eeg = raw_csd.get_data("csd")
      assert not (orig_eeg == new_eeg).any()
  
      # reset the only things that should change, and assert objects are the same
      assert (
          raw_csd.info["custom_ref_applied"]
          == FIFF.FIFFV_MNE_CUSTOM_REF_CSD
      )
      with raw_csd.info._unlock():
          raw_csd.info["custom_ref_applied"] = 0
      for pick in picks:
          ch = raw_csd.info["chs"][pick]
          assert ch["coil_type"] == FIFF.FIFFV_COIL_EEG_CSD
          assert ch["unit"] == FIFF.FIFF_UNIT_V_M2
          ch.update(
              coil_type=FIFF.FIFFV_COIL_EEG, unit=FIFF.FIFF_UNIT_V
          )
          raw_csd._data[pick] = raw._data[pick]
      assert object_diff(raw.info, raw_csd.info) == ""
  
file_path: mne-python/mne/preprocessing/tests/test_csd.py
imports: from pathlib import Path
  import numpy
  import pytest
  from numpy.testing import assert_allclose
  from scipy import linalg
  from scipy.io import loadmat
  from mne import Epochs, EvokedArray, create_info, find_events, pick_types, read_epochs
  from mne._fiff.constants import FIFF
  from mne.channels import make_dig_montage
  from mne.datasets import testing
  from mne.io import RawArray, read_raw_fif
  from mne.preprocessing import compute_bridged_electrodes, compute_current_source_density
  from mne.utils import object_diff
label_desc: Use image node_id 4 for calling a global function with example usage: test_csd_fif() without return types