code: def _throw_or_return_empty(msg, throw_errors):
      if throw_errors:
          raise ValueError(msg)
      else:
          return []
  
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 6 for calling a global function with example usage: _throw_or_return_empty(msg, throw_errors) and returns: list