code: def _pinv_trunc(x, miss):
      """Compute pseudoinverse, truncating at most "miss" fraction of varexp."""
      u, s, v = _safe_svd(x, full_matrices=False)
  
      # Eigenvalue truncation
      varexp = np.cumsum(s)
      varexp /= varexp[-1]
      n = np.where(varexp >= (1.0 - miss))[0][0] + 1
      logger.info(
          "    Truncating at %d/%d components to omit less than %g "
          "(%0.2g)" % (n, len(s), miss, 1.0 - varexp[n - 1])
      )
      s = 1.0 / s[:n]
      inv = ((u[:, :n] * s) @ v[:n]).T
      return inv, n
  
imports: import inspect
  from copy import deepcopy
  import numpy
  from scipy.interpolate import interp1d
  from .._fiff.constants import FIFF
  from .._fiff.meas_info import _simplify_info
  from .._fiff.pick import pick_info, pick_types
  from .._fiff.proj import _has_eeg_average_ref_proj, make_projector
  from ..bem import _check_origin
  from ..cov import make_ad_hoc_cov
  from ..epochs import BaseEpochs, EpochsArray
  from ..evoked import Evoked, EvokedArray
  from ..fixes import _safe_svd
  from ..surface import get_head_surf, get_meg_helmet_surf
  from ..transforms import _find_trans, _get_trans, transform_surface_to
  from ..utils import _check_fname, _check_option, _pl, _reg_pinv, logger, verbose
  from ._lead_dots import _do_cross_dots, _do_self_dots, _do_surface_dots, _get_legen_table
  from ._make_forward import _create_eeg_els, _create_meg_coils, _read_coil_defs
label_desc: Use image node_id 3 for calling a global function with example usage: _pinv_trunc(x, miss) and returns: inv,  n