code: def test_ch_types():
      """Test reading of channel types from EDF channel label."""
      raw = read_raw_edf(edf_chtypes_path)  # infer_types=False
  
      labels = [
          "EEG Fp1-Ref",
          "EEG Fp2-Ref",
          "EEG F3-Ref",
          "EEG F4-Ref",
          "EEG C3-Ref",
          "EEG C4-Ref",
          "EEG P3-Ref",
          "EEG P4-Ref",
          "EEG O1-Ref",
          "EEG O2-Ref",
          "EEG F7-Ref",
          "EEG F8-Ref",
          "EEG T7-Ref",
          "EEG T8-Ref",
          "EEG P7-Ref",
          "EEG P8-Ref",
          "EEG Fz-Ref",
          "EEG Cz-Ref",
          "EEG Pz-Ref",
          "POL E",
          "POL PG1",
          "POL PG2",
          "EEG A1-Ref",
          "EEG A2-Ref",
          "POL T1",
          "POL T2",
          "ECG ECG1",
          "ECG ECG2",
          "EEG F9-Ref",
          "EEG T9-Ref",
          "EEG P9-Ref",
          "EEG F10-Ref",
          "EEG T10-Ref",
          "EEG P10-Ref",
          "SaO2 X9",
          "SaO2 X10",
          "POL DC01",
          "POL DC02",
          "POL DC03",
          "POL DC04",
          "POL $A1",
          "POL $A2",
      ]
  
      # by default all types are 'eeg'
      assert all(t == "eeg" for t in raw.get_channel_types())
      assert raw.ch_names == labels
  
      raw = read_raw_edf(edf_chtypes_path, infer_types=True)
      data = raw.get_data()
  
      labels = [
          "Fp1-Ref",
          "Fp2-Ref",
          "F3-Ref",
          "F4-Ref",
          "C3-Ref",
          "C4-Ref",
          "P3-Ref",
          "P4-Ref",
          "O1-Ref",
          "O2-Ref",
          "F7-Ref",
          "F8-Ref",
          "T7-Ref",
          "T8-Ref",
          "P7-Ref",
          "P8-Ref",
          "Fz-Ref",
          "Cz-Ref",
          "Pz-Ref",
          "POL E",
          "POL PG1",
          "POL PG2",
          "A1-Ref",
          "A2-Ref",
          "POL T1",
          "POL T2",
          "ECG1",
          "ECG2",
          "F9-Ref",
          "T9-Ref",
          "P9-Ref",
          "F10-Ref",
          "T10-Ref",
          "P10-Ref",
          "X9",
          "X10",
          "POL DC01",
          "POL DC02",
          "POL DC03",
          "POL DC04",
          "POL $A1",
          "POL $A2",
      ]
      types = [
          "eeg",
          "eeg",
          "eeg",
          "eeg",
          "eeg",
          "eeg",
          "eeg",
          "eeg",
          "eeg",
          "eeg",
          "eeg",
          "eeg",
          "eeg",
          "eeg",
          "eeg",
          "eeg",
          "eeg",
          "eeg",
          "eeg",
          "eeg",
          "eeg",
          "eeg",
          "eeg",
          "eeg",
          "eeg",
          "eeg",
          "ecg",
          "ecg",
          "eeg",
          "eeg",
          "eeg",
          "eeg",
          "eeg",
          "eeg",
          "bio",
          "bio",
          "eeg",
          "eeg",
          "eeg",
          "eeg",
          "eeg",
          "eeg",
      ]
  
      assert raw.get_channel_types() == types
      assert raw.ch_names == labels
  
      with pytest.raises(ValueError, match="cannot overwrite"):
          read_raw_edf(edf_chtypes_path, units="V")
      raw = read_raw_edf(edf_chtypes_path, units="uV")  # should be okay
      data_units = raw.get_data()
      assert_allclose(data, data_units)
  
imports: import datetime
  from contextlib import nullcontext
  from functools import partial
  from pathlib import Path
  import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_almost_equal, assert_array_equal, assert_equal
  from scipy.io import loadmat
  from mne import Annotations, pick_types
  from mne._fiff.pick import channel_indices_by_type, get_channel_type_constants
  from mne.annotations import _ndarray_ch_names, events_from_annotations, read_annotations
  from mne.datasets import testing
  from mne.io import edf, read_raw_bdf, read_raw_edf, read_raw_fif, read_raw_gdf
  from mne.io.edf.edf import _edf_str, _parse_prefilter_string, _read_annotations_edf, _read_ch, _read_edf_header, _read_header
  from mne.io.tests.test_raw import _test_raw_reader
  from mne.tests.test_annotations import _assert_annotations_equal
label_desc: Use image node_id 34 for calling a global function with example usage: test_ch_types() without return types