code: def test_order_agnostic(nirx_snirf):
      """Test that order does not matter to (pre)processing results."""
      raw_nirx, raw_snirf = nirx_snirf
      raw_random = raw_nirx.copy().pick(
          np.random.RandomState(0).permutation(len(raw_nirx.ch_names))
      )
      raws = dict(nirx=raw_nirx, snirf=raw_snirf, random=raw_random)
      del raw_nirx, raw_snirf, raw_random
      orders = dict()
      # continuous wave
      for key, r in raws.items():
          assert set(r.get_channel_types()) == {"fnirs_cw_amplitude"}
          orders[key] = [
              r.ch_names.index(name) for name in raws["nirx"].ch_names
          ]
          assert_array_equal(
              raws["nirx"].ch_names, np.array(r.ch_names)[orders[key]]
          )
          assert_allclose(
              raws["nirx"].get_data(),
              r.get_data(orders[key]),
              err_msg=key,
          )
      assert_array_equal(
          orders["nirx"], np.arange(len(raws["nirx"].ch_names))
      )
      # optical density
      for key, r in raws.items():
          raws[key] = r = optical_density(r)
          assert_allclose(
              raws["nirx"].get_data(),
              r.get_data(orders[key]),
              err_msg=key,
          )
          assert set(r.get_channel_types()) == {"fnirs_od"}
      # scalp-coupling index
      sci = dict()
      for key, r in raws.items():
          sci[key] = r = scalp_coupling_index(r)
          assert_allclose(
              sci["nirx"], r[orders[key]], err_msg=key, rtol=0.01
          )
      # TDDR (on optical)
      tddrs = dict()
      for key, r in raws.items():
          tddrs[key] = r = tddr(r)
          assert_allclose(
              tddrs["nirx"].get_data(),
              r.get_data(orders[key]),
              err_msg=key,
              atol=1e-4,
          )
          assert set(r.get_channel_types()) == {"fnirs_od"}
      # beer-lambert
      for key, r in raws.items():
          raws[key] = r = beer_lambert_law(r)
          assert_allclose(
              raws["nirx"].get_data(),
              r.get_data(orders[key]),
              err_msg=key,
              rtol=2e-7,
          )
          assert set(r.get_channel_types()) == {"hbo", "hbr"}
      # TDDR (on haemo)
      tddrs = dict()
      for key, r in raws.items():
          tddrs[key] = r = tddr(r)
          assert_allclose(
              tddrs["nirx"].get_data(),
              r.get_data(orders[key]),
              err_msg=key,
              atol=1e-9,
          )
          assert set(r.get_channel_types()) == {"hbo", "hbr"}
  
imports: import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_almost_equal, assert_array_equal
  from mne import create_info
  from mne._fiff.constants import FIFF
  from mne._fiff.pick import _picks_to_idx
  from mne.datasets import testing
  from mne.datasets.testing import data_path
  from mne.io import RawArray, read_raw_nirx
  from mne.preprocessing.nirs import _channel_chromophore, _channel_frequencies, _check_channels_ordered, _fnirs_optode_names, _fnirs_spread_bads, _optode_position, _validate_nirs_info, beer_lambert_law, optical_density, scalp_coupling_index, tddr
label_desc: Use image node_id 11 for calling a global function with example usage: test_order_agnostic(nirx_snirf) without return types