code: def test_sample_rate_jitter(tmp_path):
      """Test handling of jittered sample times."""
      from shutil import copy2
  
      # Create a clean copy and ensure it loads without error
      new_file = tmp_path / "snirf_nirsport2_2019.snirf"
      copy2(snirf_nirsport2_20219, new_file)
      read_raw_snirf(new_file)
  
      # Edit the file and add jitter within tolerance (0.99%)
      with h5py.File(new_file, "r+") as f:
          orig_time = np.array(f.get("nirs/data1/time"))
          acceptable_time_jitter = orig_time.copy()
          average_time_diff = np.mean(np.diff(orig_time))
          acceptable_time_jitter[-1] += 0.0099 * average_time_diff
          del f["nirs/data1/time"]
          f.flush()
          f.create_dataset(
              "nirs/data1/time", data=acceptable_time_jitter
          )
      with catch_logging("info") as log:
          read_raw_snirf(new_file)
      lines = "\n".join(
          line
          for line in log.getvalue().splitlines()
          if "jitter" in line
      )
      assert "Found jitter of 0.9" in lines
  
      # Add jitter of 1.01%, which is greater than allowed tolerance
      with h5py.File(new_file, "r+") as f:
          unacceptable_time_jitter = orig_time
          unacceptable_time_jitter[-1] = unacceptable_time_jitter[
              -1
          ] + (0.0101 * average_time_diff)
          del f["nirs/data1/time"]
          f.flush()
          f.create_dataset(
              "nirs/data1/time", data=unacceptable_time_jitter
          )
      with pytest.warns(
          RuntimeWarning, match="non-uniformly-sampled data"
      ):
          read_raw_snirf(new_file, verbose=True)
  
imports: import shutil
  import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_almost_equal, assert_equal
  from mne._fiff.constants import FIFF
  from mne.datasets.testing import data_path, requires_testing_data
  from mne.io import read_raw_nirx, read_raw_snirf
  from mne.io.tests.test_raw import _test_raw_reader
  from mne.preprocessing.nirs import _reorder_nirx, beer_lambert_law, optical_density, short_channels, source_detector_distances
  from mne.transforms import _get_trans, apply_trans
  from mne.utils import catch_logging
label_desc: Use image node_id 16 for calling a global function with example usage: test_sample_rate_jitter(tmp_path) without return types