code: def _annot_to_onset_dur(raw, other):
      onsets_raw = raw.annotations.onset - raw.first_time
      dur_raw = raw.annotations.duration
  
      onsets_other = other.annotations.onset - other.first_time
      dur_other = other.annotations.duration
      return onsets_raw, dur_raw, onsets_other, dur_other
  
file_path: mne-python/mne/preprocessing/tests/test_realign.py
imports: import numpy
  import pytest
  from numpy.testing import assert_allclose
  from scipy.interpolate import interp1d
  from mne import Annotations, Epochs, create_info, find_events
  from mne.io import RawArray
  from mne.preprocessing import realign_raw
label_desc: Use image node_id 4 for calling a global function with example usage: _annot_to_onset_dur(raw, other) and returns: onsets_raw,  dur_raw,  onsets_other,  dur_other