code: def _summarise_psf_ctf(funcs, mode, n_comp, return_pca_vars, nn):
      """Summarise PSFs/CTFs across vertices."""
      s_var = None  # only computed for return_pca_vars=True
  
      if mode == "maxval":  # pick PSF/CTF with maximum absolute value
          absvals = np.maximum(
              -np.min(funcs, axis=0), np.max(funcs, axis=0)
          )
          if (
              n_comp > 1
          ):  # only keep requested number of sorted PSFs/CTFs
              sortidx = np.argsort(absvals)
              maxidx = sortidx[-n_comp:]
          else:  # faster if only one required
              maxidx = [absvals.argmax()]
          funcs = funcs[:, maxidx]
  
      elif mode == "maxnorm":  # pick PSF/CTF with maximum norm
          norms = np.linalg.norm(funcs, axis=0)
          if (
              n_comp > 1
          ):  # only keep requested number of sorted PSFs/CTFs
              sortidx = np.argsort(norms)
              maxidx = sortidx[-n_comp:]
          else:  # faster if only one required
              maxidx = [norms.argmax()]
          funcs = funcs[:, maxidx]
  
      elif mode == "sum":  # sum across PSFs/CTFs
          funcs = np.sum(funcs, axis=1, keepdims=True)
  
      elif mode == "mean":  # mean of PSFs/CTFs
          funcs = np.mean(funcs, axis=1, keepdims=True)
  
      elif mode == "pca":  # SVD across PSFs/CTFs
          # compute SVD of PSFs/CTFs across vertices
          u, s, _ = np.linalg.svd(
              funcs, full_matrices=False, compute_uv=True
          )
          if n_comp > 1:
              funcs = u[:, :n_comp]
          else:
              funcs = u[:, 0, np.newaxis]
          # if explained variances for SVD components requested
          if return_pca_vars:
              # explained variance of individual SVD components
              s2 = s * s
              s_var = 100 * s2[:n_comp] / s2.sum()
  
      return funcs, s_var
  
imports: from copy import deepcopy
  import numpy
  from mne.minimum_norm.inverse import InverseOperator
  from .._fiff.constants import FIFF
  from .._fiff.pick import pick_channels_forward
  from ..evoked import EvokedArray
  from ..forward.forward import Forward, convert_forward_solution
  from ..label import Label
  from ..source_estimate import _get_src_type, _make_stc, _prepare_label_extraction
  from ..source_space._source_space import SourceSpaces, _get_vertno
  from ..utils import _validate_type, logger, verbose
  from .inverse import apply_inverse
label_desc: Use image node_id 6 for calling a global function with example usage: _summarise_psf_ctf(funcs, mode, n_comp, return_pca_vars, nn) and returns: funcs,  s_var