code: def _make_interpolation_matrix(pos_from, pos_to, alpha=1e-5):
      """Compute interpolation matrix based on spherical splines.
  
      Implementation based on [1]
  
      Parameters
      ----------
      pos_from : np.ndarray of float, shape(n_good_sensors, 3)
          The positions to interpolate from.
      pos_to : np.ndarray of float, shape(n_bad_sensors, 3)
          The positions to interpolate.
      alpha : float
          Regularization parameter. Defaults to 1e-5.
  
      Returns
      -------
      interpolation : np.ndarray of float, shape(len(pos_from), len(pos_to))
          The interpolation matrix that maps good signals to the location
          of bad signals.
  
      References
      ----------
      [1] Perrin, F., Pernier, J., Bertrand, O. and Echallier, JF. (1989).
          Spherical splines for scalp potential and current density mapping.
          Electroencephalography Clinical Neurophysiology, Feb; 72(2):184-7.
      """
      pos_from = pos_from.copy()
      pos_to = pos_to.copy()
      n_from = pos_from.shape[0]
      n_to = pos_to.shape[0]
  
      # normalize sensor positions to sphere
      _normalize_vectors(pos_from)
      _normalize_vectors(pos_to)
  
      # cosine angles between source positions
      cosang_from = pos_from.dot(pos_from.T)
      cosang_to_from = pos_to.dot(pos_from.T)
      G_from = _calc_g(cosang_from)
      G_to_from = _calc_g(cosang_to_from)
      assert G_from.shape == (n_from, n_from)
      assert G_to_from.shape == (n_to, n_from)
  
      if alpha is not None:
          G_from.flat[:: len(G_from) + 1] += alpha
  
      C = np.vstack(
          [
              np.hstack([G_from, np.ones((n_from, 1))]),
              np.hstack([np.ones((1, n_from)), [[0]]]),
          ]
      )
      C_inv = pinv(C)
  
      interpolation = (
          np.hstack([G_to_from, np.ones((n_to, 1))]) @ C_inv[:, :-1]
      )
      assert interpolation.shape == (n_to, n_from)
      return interpolation
  
imports: import numpy
  from numpy.polynomial.legendre import legval
  from scipy.interpolate import RectBivariateSpline
  from scipy.linalg import pinv
  from scipy.spatial.distance import pdist, squareform
  from .._fiff.meas_info import _simplify_info
  from .._fiff.pick import pick_channels, pick_info, pick_types
  from ..surface import _normalize_vectors
  from ..utils import _validate_type, logger, verbose, warn
label_desc: Use image node_id 3 for calling a global function with example usage: _make_interpolation_matrix(pos_from, pos_to, alpha) and returns: interpolation