code: def _create_annotation_based_on_descr(
      description, annotation_start_sampl=0, duration=0, orig_time=0
  ):
      """Create a raw object with annotations from descriptions.
  
      The returning raw object contains as many annotations as description given.
      All starting at `annotation_start_sampl`.
      """
      # create dummy raw
      raw = RawArray(
          data=np.empty([10, 10], dtype=np.float64),
          info=create_info(ch_names=10, sfreq=1000.0),
          first_samp=0,
      )
      raw.set_meas_date(0)
  
      # create dummy annotations based on the descriptions
      onset = raw.times[annotation_start_sampl]
      onset_matching_desc = np.full_like(
          description, onset, dtype=type(onset)
      )
      duration_matching_desc = np.full_like(
          description, duration, dtype=type(duration)
      )
      annot = Annotations(
          description=description,
          onset=onset_matching_desc,
          duration=duration_matching_desc,
          orig_time=orig_time,
      )
  
      if duration != 0:
          with pytest.warns(
              RuntimeWarning, match="Limited.*expanding outside"
          ):
              # duration 0.1s is larger than the raw data expand
              raw.set_annotations(annot)
      else:
          raw.set_annotations(annot)
  
      # Make sure that set_annotations(annot) works
      assert all(raw.annotations.onset == onset)
      if duration != 0:
          expected_duration = (
              len(raw.times) / raw.info["sfreq"]
          ) - onset
      else:
          expected_duration = 0
      _duration = raw.annotations.duration[0]
      assert _duration == approx(expected_duration)
      assert all(raw.annotations.duration == _duration)
      assert all(raw.annotations.description == description)
  
      return raw
  
imports: import sys
  from collections import OrderedDict
  from datetime import datetime, timedelta, timezone
  from itertools import repeat
  from pathlib import Path
  import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_almost_equal, assert_array_equal, assert_equal
  from pytest import approx
  import mne
  from mne import Annotations, Epochs, annotations_from_events, count_annotations, create_info, events_from_annotations, read_annotations
  from mne.annotations import _handle_meas_date, _read_annotations_txt_parse_header, _sync_onset
  from mne.datasets import testing
  from mne.io import RawArray, concatenate_raws, read_raw_fif
  from mne.utils import _dt_to_stamp, _raw_annot, _record_warnings, _stamp_to_dt, assert_and_remove_boundary_annot, catch_logging, check_version
label_desc: Use image node_id 19 for calling a global function with example usage: _create_annotation_based_on_descr(description, annotation_start_sampl, duration, orig_time) and returns: raw