code: def test_subject_info(tmp_path):
      """Test exposure of original channel units."""
      raw = read_raw_edf(edf_stim_resamp_path, preload=True)
  
      # check subject_info from `info`
      assert raw.info["subject_info"] is not None
      want = {
          "his_id": "X",
          "sex": 1,
          "birthday": (1967, 10, 9),
          "last_name": "X",
      }
      for key, val in want.items():
          assert raw.info["subject_info"][key] == val, key
  
      # check "subject_info" from `_raw_extras`
      edf_info = raw._raw_extras[0]
      assert edf_info["subject_info"] is not None
      want = {
          "id": "X",
          "sex": "M",
          "birthday": datetime.datetime(1967, 10, 9, 0, 0),
          "name": "X",
      }
      for key, val in want.items():
          assert edf_info["subject_info"][key] == val, key
  
      # add information
      raw.info["subject_info"]["hand"] = 0
  
      # save raw to FIF and load it back
      fname = tmp_path / "test_raw.fif"
      raw.save(fname)
      raw = read_raw_fif(fname)
  
      # check subject_info from `info`
      assert raw.info["subject_info"] is not None
      want = {
          "his_id": "X",
          "sex": 1,
          "birthday": (1967, 10, 9),
          "last_name": "X",
          "hand": 0,
      }
      for key, val in want.items():
          assert raw.info["subject_info"][key] == val
  
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 4 for calling a global function with example usage: test_subject_info(tmp_path) without return types