code: def find_stim_steps(
      raw, pad_start=None, pad_stop=None, merge=0, stim_channel=None
  ):
      """Find all steps in data from a stim channel.
  
      Parameters
      ----------
      raw : Raw object
          The raw data.
      pad_start : None | int
          Values to assume outside of the stim channel (e.g., if pad_start=0 and
          the stim channel starts with value 5, an event of [0, 0, 5] will be
          inserted at the beginning). With None, no steps will be inserted.
      pad_stop : None | int
          Values to assume outside of the stim channel, see ``pad_start``.
      merge : int
          Merge steps occurring in neighboring samples. The integer value
          indicates over how many samples events should be merged, and the sign
          indicates in which direction they should be merged (negative means
          towards the earlier event, positive towards the later event).
      stim_channel : None | str | list of str
          Name of the stim channel or all the stim channels
          affected by the trigger. If None, the config variables
          'MNE_STIM_CHANNEL', 'MNE_STIM_CHANNEL_1', 'MNE_STIM_CHANNEL_2',
          etc. are read. If these are not found, it will default to
          'STI101' or 'STI 014', whichever is present.
  
      Returns
      -------
      steps : array, shape = (n_samples, 3)
          For each step in the stim channel the values [sample, v_from, v_to].
          The first column contains the event time in samples (the first sample
          with the new value). The second column contains the stim channel value
          before the step, and the third column contains value after the step.
  
      See Also
      --------
      find_events : More sophisticated options for finding events in a Raw file.
      """
      # pull stim channel from config if necessary
      stim_channel = _get_stim_channel(stim_channel, raw.info)
  
      picks = pick_channels(
          raw.info["ch_names"], include=stim_channel, ordered=False
      )
      if len(picks) == 0:
          raise ValueError(
              "No stim channel found to extract event triggers."
          )
      data, _ = raw[picks, :]
      if np.any(data < 0):
          warn(
              "Trigger channel contains negative values, using absolute value."
          )
          data = np.abs(data)  # make sure trig channel is positive
      data = data.astype(np.int64)
  
      return _find_stim_steps(
          data,
          raw.first_samp,
          pad_start=pad_start,
          pad_stop=pad_stop,
          merge=merge,
      )
  
imports: from collections.abc import Sequence
  from pathlib import Path
  import numpy
  from ._fiff.constants import FIFF
  from ._fiff.open import fiff_open
  from ._fiff.pick import pick_channels
  from ._fiff.tag import read_tag
  from ._fiff.tree import dir_tree_find
  from ._fiff.write import end_block, start_and_end_file, start_block, write_int
  from .utils import _check_fname, _check_integer_or_list, _check_on_missing, _check_option, _get_stim_channel, _on_missing, _pl, _validate_type, check_fname, fill_doc, logger, verbose, warn
label_desc: Use image node_id 7 for calling a global function with example usage: find_stim_steps(raw, pad_start, pad_stop, merge, stim_channel) and returns: _find_stim_steps