code: def test_get_subjects_dir(tmp_path, monkeypatch):
      """Test get_subjects_dir()."""
      subjects_dir = tmp_path / "foo"
      subjects_dir.mkdir()
  
      # String
      assert get_subjects_dir(str(subjects_dir)) == subjects_dir
  
      # Path
      assert get_subjects_dir(subjects_dir) == subjects_dir
  
      # `None`
      monkeypatch.setenv("_MNE_FAKE_HOME_DIR", str(tmp_path))
      monkeypatch.delenv("SUBJECTS_DIR", raising=False)
      assert get_subjects_dir() is None
  
      # Expand `~`
      monkeypatch.setenv("HOME", str(tmp_path))
      monkeypatch.setenv("USERPROFILE", str(tmp_path))  # Windows
      assert str(get_subjects_dir("~/foo")) == str(subjects_dir)
  
file_path: mne-python/mne/utils/tests/test_config.py
imports: import os
  import platform
  import re
  from functools import partial
  from pathlib import Path
  from urllib.error import URLError
  import pytest
  import mne
  import mne.utils.config
  from mne.utils import ClosingStringIO, _get_stim_channel, get_config, get_config_path, get_subjects_dir, requires_good_network, set_config, set_memmap_min_size, sys_info
label_desc: Use image node_id 4 for calling a global function with example usage: test_get_subjects_dir(tmp_path, monkeypatch) without return types