code: def _validate_nirs_info(
      info,
      *,
      throw_errors=True,
      fnirs=None,
      which=None,
      check_bads=True,
      allow_empty=True,
  ):
      """Apply all checks to fNIRS info. Works on all continuous wave types."""
      _validate_type(fnirs, (None, str), "fnirs")
      kinds = dict(
          od="optical density",
          cw_amplitude="continuous wave",
          hb="chromophore",
      )
      _check_option("fnirs", fnirs, (None,) + tuple(kinds))
      if fnirs is not None:
          kind = kinds[fnirs]
          fnirs = ["hbo", "hbr"] if fnirs == "hb" else f"fnirs_{fnirs}"
          if not len(pick_types(info, fnirs=fnirs)):
              raise RuntimeError(
                  f"{which} must operate on {kind} data, but none was found."
              )
      freqs = np.unique(_channel_frequencies(info))
      if freqs.size > 0:
          pair_vals = freqs
      else:
          pair_vals = np.unique(_channel_chromophore(info))
      out = _check_channels_ordered(
          info,
          pair_vals,
          throw_errors=throw_errors,
          check_bads=check_bads,
      )
      return out
  
file_path: mne-python/mne/preprocessing/nirs/nirs.py
imports: import re
  import numpy
  from ..._fiff.pick import _picks_to_idx, pick_types
  from ...utils import _check_option, _validate_type, fill_doc
label_desc: Use image node_id 7 for calling a global function with example usage: _validate_nirs_info(info) and returns: out