code: def test_meas_date_orig_time():
      """Test the relation between meas_time in orig_time."""
      # meas_time is set and orig_time is set:
      # clips the annotations based on raw.data and resets the annotation based
      # on raw.info['meas_date]
      raw = _raw_annot(1, 1.5)
      assert raw.annotations.orig_time == _stamp_to_dt((1, 0))
      assert raw.annotations.onset[0] == 1
  
      # meas_time is set and orig_time is None:
      # Consider annot.orig_time to be raw.frist_sample, clip and reset
      # annotations to have the raw.annotations.orig_time == raw.info['meas_date]
      raw = _raw_annot(1, None)
      assert raw.annotations.orig_time == _stamp_to_dt((1, 0))
      assert raw.annotations.onset[0] == 1.5
  
      # meas_time is None and orig_time is set:
      # Raise error, it makes no sense to have an annotations object that we know
      # when was acquired and set it to a raw object that does not know when was
      # it acquired.
      with pytest.raises(RuntimeError, match="Ambiguous operation"):
          _raw_annot(None, 1.5)
  
      # meas_time is None and orig_time is None:
      # Consider annot.orig_time to be raw.first_sample and clip
      raw = _raw_annot(None, None)
      assert raw.annotations.orig_time is None
      assert raw.annotations.onset[0] == 1.5
      assert raw.annotations.duration[0] == 0.2
  
imports: import math
  import os
  import re
  from contextlib import redirect_stdout
  from io import StringIO
  from os import path
  from pathlib import Path
  import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_almost_equal, assert_array_equal, assert_array_less
  import mne
  from mne import Annotations, concatenate_raws, create_info, pick_types
  from mne._fiff._digitization import DigPoint, _dig_kind_dict
  from mne._fiff.constants import FIFF
  from mne._fiff.meas_info import Info, _get_valid_units, _writing_info_hdf5
  from mne._fiff.pick import _ELECTRODE_CH_TYPES, _FNIRS_CH_TYPES_SPLIT
  from mne._fiff.proj import Projection
  from mne._fiff.utils import _mult_cal_one
  from mne.fixes import _numpy_h5py_dep
  from mne.io import BaseRaw, RawArray, read_raw_fif
  from mne.io.base import _get_scaling
  from mne.transforms import Transform
  from mne.utils import _import_h5io_funcs, _raw_annot, _stamp_to_dt, _TempDir, catch_logging, check_version, object_diff
label_desc: Use image node_id 10 for calling a global function with example usage: test_meas_date_orig_time() without return types