code: def test_beer_lambert_unordered_errors():
      """NIRS data requires specific ordering and naming of channels."""
      raw = read_raw_nirx(fname_nirx_15_0)
      raw_od = optical_density(raw)
      raw_od.pick([0, 1, 2])
      with pytest.raises(ValueError, match="ordered"):
          beer_lambert_law(raw_od)
  
      # Test that an error is thrown if channel naming frequency doesn't match
      # what is stored in loc[9], which should hold the light frequency too.
      raw_od = optical_density(raw)
      ch_name = raw.ch_names[0]
      assert ch_name == "S1_D1 760"
      idx = raw_od.ch_names.index(ch_name)
      assert idx == 0
      raw_od.info["chs"][idx]["loc"][9] = 770
      raw_od.rename_channels({ch_name: ch_name.replace("760", "770")})
      assert raw_od.ch_names[0] == "S1_D1 770"
      with pytest.raises(ValueError, match="Exactly two frequencies"):
          beer_lambert_law(raw_od)
  
file_path: mne-python/mne/preprocessing/nirs/tests/test_beer_lambert_law.py
imports: import numpy
  import pytest
  from mne.datasets import testing
  from mne.datasets.testing import data_path
  from mne.io import BaseRaw, read_raw_fif, read_raw_nirx
  from mne.preprocessing.nirs import beer_lambert_law, optical_density
  from mne.utils import _validate_type
label_desc: Use image node_id 2 for calling a global function with example usage: test_beer_lambert_unordered_errors() without return types