code: def _test_raw_crop(reader, t_prop, kwargs):
      raw_1 = reader(**kwargs)
      n_samp = 50  # crop to this number of samples (per instance)
      crop_t = n_samp / raw_1.info["sfreq"]
      t_start = (
          t_prop * crop_t
      )  # also crop to some fraction into the first inst
      extra = (
          f' t_start={t_start}, preload={kwargs.get("preload", False)}'
      )
      stop = (n_samp - 1) / raw_1.info["sfreq"]
      raw_1.crop(0, stop)
      assert len(raw_1.times) == 50
      first_time = raw_1.first_time
      atol = 0.5 / raw_1.info["sfreq"]
      assert_allclose(raw_1.times[-1], stop, atol=atol)
      raw_2, raw_3 = raw_1.copy(), raw_1.copy()
      t_tot = raw_1.times[-1] * 3 + 2.0 / raw_1.info["sfreq"]
      raw_concat = concatenate_raws([raw_1, raw_2, raw_3])
      assert len(raw_concat._filenames) == 3
      assert_allclose(raw_concat.times[-1], t_tot)
      assert_allclose(raw_concat.first_time, first_time)
      # keep all instances, but crop to t_start at the beginning
      raw_concat.crop(t_start, None)
      assert len(raw_concat._filenames) == 3
      assert_allclose(raw_concat.times[-1], t_tot - t_start, atol=atol)
      assert_allclose(
          raw_concat.first_time,
          first_time + t_start,
          atol=atol,
          err_msg=f"Base concat, {extra}",
      )
      # drop the first instance
      raw_concat.crop(crop_t, None)
      assert len(raw_concat._filenames) == 2
      assert_allclose(
          raw_concat.times[-1], t_tot - t_start - crop_t, atol=atol
      )
      assert_allclose(
          raw_concat.first_time,
          first_time + t_start + crop_t,
          atol=atol,
          err_msg=f"Dropping one, {extra}",
      )
      # drop the second instance, leaving just one
      raw_concat.crop(crop_t, None)
      assert len(raw_concat._filenames) == 1
      assert_allclose(
          raw_concat.times[-1], t_tot - t_start - 2 * crop_t, atol=atol
      )
      assert_allclose(
          raw_concat.first_time,
          first_time + t_start + 2 * crop_t,
          atol=atol,
          err_msg=f"Dropping two, {extra}",
      )
  
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 5 for calling a global function with example usage: _test_raw_crop(reader, t_prop, kwargs) without return types