code: def test_plot_evoked_topomap_border():
      """Test topomap extrapolation border values."""
      # make some fake sensor locations: 25 sensors at distances of 0.2 to 1.0
      # in steps of 0.2 in the ±x, ±y, and +z directions
      ch_pos = np.array(
          [
              [
                  [r, 0, 0],  # +x
                  [-r, 0, 0],  # -x
                  [0, r, 0],  # +y
                  [0, -r, 0],  # -y
                  [0, 0, r],  # +z
              ]
              for r in np.linspace(0.2, 1, 5)
          ]
      ).reshape(-1, 3)
      info = create_info(len(ch_pos), 250, "eeg")
      ch_pos_dict = {
          name: pos for name, pos in zip(info["ch_names"], ch_pos)
      }
      dig = make_dig_montage(ch_pos_dict, coord_frame="head")
      info.set_montage(dig)
      # simulate data
      data = np.full(len(ch_pos), 5)
      kwargs = dict(res=15, extrapolate="head", sphere=1, sensors=False)
      idx = kwargs["res"] // 2
  
      # when border=0...
      img, _ = plot_topomap(data, info, border=0, **kwargs)
      img_data = img.get_array().data
      # middle pixel should exactly equal sensor data:
      assert_equal(img_data[idx, idx], data[0])
      # corner pixel should be close(ish) to zero:
      assert img_data[0, 0] < 1.5
  
      # when border='mean'...
      img, _ = plot_topomap(data, info, border="mean", **kwargs)
      img_data = img.get_array().data
      # middle pixel should exactly equal sensor data:
      assert_equal(img_data[idx, idx], data[0])
      # and corner pixel should *also* be very close to sensor data:
      assert_almost_equal(img_data[idx, idx], data[0], decimal=9)
  
imports: from functools import partial
  from pathlib import Path
  import matplotlib
  import matplotlib.pyplot
  import numpy
  import pytest
  from matplotlib.patches import Circle
  from numpy.testing import assert_almost_equal, assert_array_equal, assert_equal
  from mne import Epochs, EvokedArray, Projection, compute_proj_evoked, compute_proj_raw, create_info, find_layout, make_fixed_length_events, pick_types, read_cov, read_evokeds, read_proj
  from mne._fiff.compensator import get_current_comp
  from mne._fiff.constants import FIFF
  from mne._fiff.pick import _picks_to_idx, channel_indices_by_type, pick_info
  from mne._fiff.proj import make_eeg_average_ref_proj
  from mne.channels import find_ch_adjacency, make_dig_montage, make_standard_montage, read_layout
  from mne.datasets import testing
  from mne.io import RawArray, read_info, read_raw_fif
  from mne.preprocessing import compute_bridged_electrodes
  from mne.time_frequency.tfr import AverageTFR
  from mne.viz import plot_evoked_topomap, plot_projs_topomap, topomap
  from mne.viz.tests.test_raw import _proj_status
  from mne.viz.topomap import _get_pos_outlines, _onselect, plot_arrowmap, plot_bridged_electrodes, plot_ch_adjacency, plot_psds_topomap, plot_topomap
  from mne.viz.utils import _fake_click, _fake_keypress, _fake_scroll, _find_peaks
label_desc: Use image node_id 9 for calling a global function with example usage: test_plot_evoked_topomap_border() without return types