code: def _reduce_leadfield_rank(G):
      """Reduce the rank of the leadfield."""
      # decompose lead field
      u, s, v = np.linalg.svd(G, full_matrices=False)
  
      # backproject, omitting one direction (equivalent to setting the smallest
      # singular value to zero)
      G = np.matmul(u[:, :, :-1], s[:, :-1, np.newaxis] * v[:, :-1, :])
  
      return G
  
imports: from copy import deepcopy
  import numpy
  from .._fiff.proj import Projection, make_projector
  from ..cov import Covariance, make_ad_hoc_cov
  from ..forward.forward import _restrict_forward_to_src_sel, is_fixed_orient
  from ..minimum_norm.inverse import _get_vertno, _prepare_forward
  from ..source_space._source_space import label_src_vertno_sel
  from ..time_frequency.csd import CrossSpectralDensity
  from ..utils import _check_option, _check_src_normal, _import_h5io_funcs, _pl, _reg_pinv, _sym_mat_pow, check_fname, logger, verbose, warn
label_desc: Use image node_id 4 for calling a global function with example usage: _reduce_leadfield_rank(G) and returns: G