code: def _check_stim_channel(stim_channel, ch_names):
      """Check that the stimulus channel exists in the current datafile."""
      DEFAULT_STIM_CH_NAMES = ["status", "trigger"]
  
      if stim_channel is None or stim_channel is False:
          return [], []
  
      if stim_channel is True:  # convenient aliases
          stim_channel = "auto"
  
      if isinstance(stim_channel, str):
          if stim_channel == "auto":
              if "auto" in ch_names:
                  warn(
                      RuntimeWarning,
                      "Using `stim_channel='auto'` when auto"
                      " also corresponds to a channel name is ambiguous."
                      " Please use `stim_channel=['auto']`.",
                  )
              else:
                  valid_stim_ch_names = DEFAULT_STIM_CH_NAMES
          else:
              valid_stim_ch_names = [stim_channel.lower()]
  
      elif isinstance(stim_channel, int):
          valid_stim_ch_names = [ch_names[stim_channel].lower()]
  
      elif isinstance(stim_channel, list):
          if all([isinstance(s, str) for s in stim_channel]):
              valid_stim_ch_names = [s.lower() for s in stim_channel]
          elif all([isinstance(s, int) for s in stim_channel]):
              valid_stim_ch_names = [
                  ch_names[s].lower() for s in stim_channel
              ]
          else:
              raise ValueError("Invalid stim_channel")
      else:
          raise ValueError("Invalid stim_channel")
  
      ch_names_low = [ch.lower() for ch in ch_names]
      found = list(set(valid_stim_ch_names) & set(ch_names_low))
  
      stim_channel_idxs = [ch_names_low.index(f) for f in found]
      names = [ch_names[idx] for idx in stim_channel_idxs]
      return stim_channel_idxs, names
  
file_path: mne-python/mne/io/nsx/nsx.py
imports: import os
  from datetime import datetime, timezone
  import numpy
  from ..._fiff.constants import FIFF
  from ..._fiff.meas_info import _empty_info
  from ..._fiff.utils import _file_size, _read_segments_file
  from ...annotations import Annotations
  from ...utils import fill_doc, logger, warn
  from ..base import BaseRaw, _get_scaling
label_desc: Use image node_id 6 for calling a global function with example usage: _check_stim_channel(stim_channel, ch_names) and returns: stim_channel_idxs,  names, list,  list