code: def test_optical_density():
      """Test return type for optical density."""
      raw = read_raw_nirx(fname_nirx, preload=False)
      assert "fnirs_cw_amplitude" in raw
      assert "fnirs_od" not in raw
      raw = optical_density(raw)
      _validate_type(raw, BaseRaw, "raw")
      assert "fnirs_cw_amplitude" not in raw
      assert "fnirs_od" in raw
      with pytest.raises(RuntimeError, match="on continuous wave"):
          optical_density(raw)
  
file_path: mne-python/mne/preprocessing/nirs/tests/test_optical_density.py
imports: import numpy
  import pytest
  from numpy.testing import assert_allclose
  from mne.datasets import testing
  from mne.datasets.testing import data_path
  from mne.io import BaseRaw, read_raw_nirx
  from mne.preprocessing.nirs import optical_density
  from mne.utils import _validate_type
label_desc: Use image node_id 1 for calling a global function with example usage: test_optical_density() without return types