code: def test_make_bem_model(tmp_path, kwargs, fname):
      """Test BEM model creation from Python with I/O."""
      pytest.importorskip("nibabel")
      fname_temp = tmp_path / "temp-bem.fif"
      with catch_logging() as log:
          model = make_bem_model(
              "sample",
              ico=2,
              subjects_dir=subjects_dir,
              verbose=True,
              **kwargs,
          )
      log = log.getvalue()
      if len(kwargs.get("conductivity", (0, 0, 0))) == 1:
          assert "distance" not in log
      else:
          assert (
              re.search(r"urfaces is approximately *3\.4 mm", log)
              is not None
          )
      assert (
          re.search(r"inner skull CM is *0\.65 *-9\.62 *43\.85 mm", log)
          is not None
      )
      model_c = read_bem_surfaces(fname)
      _compare_bem_surfaces(model, model_c)
      write_bem_surfaces(fname_temp, model)
      model_read = read_bem_surfaces(fname_temp)
      _compare_bem_surfaces(model, model_c)
      _compare_bem_surfaces(model_read, model_c)
      # bad conductivity
      with pytest.raises(ValueError, match="conductivity must be"):
          make_bem_model(
              "sample", 4, [0.3, 0.006], subjects_dir=subjects_dir
          )
  
imports: import re
  from copy import deepcopy
  from os import makedirs
  from pathlib import Path
  from shutil import copy
  import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_equal
  import mne
  from mne import Info, Transform, make_bem_model, make_bem_solution, make_sphere_model, read_bem_solution, read_bem_surfaces, write_bem_solution, write_bem_surfaces, write_head_bem, write_surface
  from mne._fiff.constants import FIFF
  from mne.bem import _assert_complete_surface, _assert_inside, _bem_find_surface, _check_surface_size, _get_ico_map, _ico_downsample, _order_surfaces, distance_to_bem, fit_sphere_to_headshape, make_scalp_surfaces
  from mne.datasets import testing
  from mne.io import read_info
  from mne.surface import _get_ico_surface, read_surface
  from mne.transforms import translation
  from mne.utils import catch_logging, check_version
label_desc: Use image node_id 5 for calling a global function with example usage: test_make_bem_model(tmp_path, kwargs, fname) without return types