code: def freeview_bem_surfaces(subject, subjects_dir, method):
      """View 3-Layers BEM model with Freeview.
  
      Parameters
      ----------
      subject : str
          Subject name
      subjects_dir : path-like
          Directory containing subjects data (Freesurfer SUBJECTS_DIR)
      method : str
          Can be ``'flash'`` or ``'watershed'``.
      """
      subjects_dir = str(
          get_subjects_dir(subjects_dir, raise_error=True)
      )
  
      if subject is None:
          raise ValueError("subject argument is None.")
  
      subject_dir = op.join(subjects_dir, subject)
  
      if not op.isdir(subject_dir):
          raise ValueError(
              f"Wrong path: '{subject_dir}'. Check subjects-dir or subject argument."
          )
  
      env = os.environ.copy()
      env["SUBJECT"] = subject
      env["SUBJECTS_DIR"] = subjects_dir
  
      if "FREESURFER_HOME" not in env:
          raise RuntimeError(
              "The FreeSurfer environment needs to be set up."
          )
  
      mri_dir = op.join(subject_dir, "mri")
      bem_dir = op.join(subject_dir, "bem")
      mri = op.join(mri_dir, "T1.mgz")
  
      if method == "watershed":
          bem_dir = op.join(bem_dir, "watershed")
          outer_skin = op.join(
              bem_dir, "%s_outer_skin_surface" % subject
          )
          outer_skull = op.join(
              bem_dir, "%s_outer_skull_surface" % subject
          )
          inner_skull = op.join(
              bem_dir, "%s_inner_skull_surface" % subject
          )
      else:
          if method == "flash":
              bem_dir = op.join(bem_dir, "flash")
          outer_skin = op.join(bem_dir, "outer_skin.surf")
          outer_skull = op.join(bem_dir, "outer_skull.surf")
          inner_skull = op.join(bem_dir, "inner_skull.surf")
  
      # put together the command
      cmd = ["freeview"]
      cmd += ["--volume", mri]
      cmd += ["--surface", "%s:color=red:edgecolor=red" % inner_skull]
      cmd += [
          "--surface",
          "%s:color=yellow:edgecolor=yellow" % outer_skull,
      ]
      cmd += [
          "--surface",
          "%s:color=255,170,127:edgecolor=255,170,127" % outer_skin,
      ]
  
      run_subprocess(cmd, env=env, stdout=sys.stdout)
      print("[done]")
  
imports: import os
  import os.path
  import sys
  import mne
  from mne.utils import get_subjects_dir, run_subprocess
label_desc: Use image node_id 1 for calling a global function with example usage: freeview_bem_surfaces(subject, subjects_dir, method) without return types