code: def test_make_field_map_meeg():
      """Test making a M/EEG field map onto helmet & head."""
      evoked = read_evokeds(evoked_fname, baseline=(-0.2, 0.0))[0]
      picks = pick_types(evoked.info, meg=True, eeg=True)
      picks = picks[::10]
      evoked.pick([evoked.ch_names[p] for p in picks])
      evoked.info.normalize_proj()
      maps = make_field_map(
          evoked,
          trans_fname,
          subject="sample",
          subjects_dir=subjects_dir,
          verbose="debug",
      )
      assert_equal(maps[0]["data"].shape, (642, 6))  # EEG->Head
      assert_equal(maps[1]["data"].shape, (304, 31))  # MEG->Helmet
      # reasonable ranges
      maxs = (1.2, 2.0)  # before #4418, was (1.1, 2.0)
      mins = (-0.8, -1.3)  # before #4418, was (-0.6, -1.2)
      assert_equal(len(maxs), len(maps))
      for map_, max_, min_ in zip(maps, maxs, mins):
          assert_allclose(map_["data"].max(), max_, rtol=5e-2)
          assert_allclose(map_["data"].min(), min_, rtol=5e-2)
      # calculated from correct looking mapping on 2015/12/26
      assert_allclose(
          np.sqrt(np.sum(maps[0]["data"] ** 2)),
          19.0903,
          atol=1e-3,
          rtol=1e-3,
      )
      assert_allclose(
          np.sqrt(np.sum(maps[1]["data"] ** 2)),
          19.4748,
          atol=1e-3,
          rtol=1e-3,
      )
  
imports: from os import path
  from pathlib import Path
  import numpy
  import pytest
  from numpy.polynomial import legendre
  from numpy.testing import assert_allclose, assert_array_almost_equal, assert_array_equal, assert_equal
  from scipy.interpolate import interp1d
  import mne
  from mne import Epochs, make_fixed_length_events, pick_types, read_evokeds
  from mne.datasets import testing
  from mne.forward import _make_surface_mapping, make_field_map
  from mne.forward._field_interpolation import _setup_dots
  from mne.forward._lead_dots import _comp_sum_eeg, _comp_sums_meg, _do_cross_dots, _get_legen_table
  from mne.forward._make_forward import _create_meg_coils
  from mne.io import read_raw_fif
  from mne.surface import get_head_surf, get_meg_helmet_surf
label_desc: Use image node_id 6 for calling a global function with example usage: test_make_field_map_meeg() without return types