code: def _compute_proj(
      data,
      info,
      n_grad,
      n_mag,
      n_eeg,
      desc_prefix,
      meg="separate",
      verbose=None,
  ):
      _validate_type(n_grad, "numeric", "n_grad", "float or int")
      _validate_type(n_mag, "numeric", "n_grad", "float or int")
      _validate_type(n_eeg, "numeric", "n_eeg", "float or int")
      for n_, n_name in (
          (n_grad, "n_grad"),
          (n_mag, "n_mag"),
          (n_eeg, "n_eeg"),
      ):
          if n_ < 0:
              raise ValueError(
                  f"Argument '{n_name}' must be either a positive integer or a float "
                  f"between 0 and 1. '{n_}' is invalid."
              )
      _check_option("meg", meg, ("separate", "combined"))
      if meg == "combined":
          if n_grad != n_mag:
              raise ValueError(
                  f"n_grad ({n_grad}) must be equal to n_mag ({n_mag}) when using "
                  "meg='combined'."
              )
          ch_types = ("meg", "eeg")
          n_vectors = (n_grad, n_eeg)
          kinds = ("meg", "eeg")
      else:
          ch_types = ("grad", "mag", "eeg")
          n_vectors = (n_grad, n_mag, n_eeg)
          kinds = ("planar", "axial", "eeg")
  
      projs = []
      for ch_type, n_vector, kind in zip(ch_types, n_vectors, kinds):
          # select channels to use
          try:
              idx = _picks_to_idx(
                  info, ch_type, with_ref_meg=False, exclude="bads"
              )
          except ValueError:
              logger.info("No channels '%s' found. Skipping.", ch_type)
              continue
          names = [info["ch_names"][k] for k in idx]
  
          data_ = data[idx][
              :, idx
          ]  # data is the covariance matrix: U * S**2 * Ut
          U, Sexp2, _ = _safe_svd(data_, full_matrices=False)
          exp_var = Sexp2 / Sexp2.sum()
  
          # select vectors to use
          if 0 < n_vector < 1:
              n_vector = (
                  np.searchsorted(np.cumsum(exp_var), n_vector, "left")
                  + 1
              )
          U = U[:, :n_vector]
          exp_var = exp_var[:n_vector]
  
          # create projectors
          for k, (u, var) in enumerate(zip(U.T, exp_var)):
              proj_data = dict(
                  col_names=names,
                  row_names=None,
                  data=u[np.newaxis, :],
                  nrow=1,
                  ncol=u.size,
              )
              desc = f"{kind}-{desc_prefix}-PCA-{k + 1:02d}"
              logger.info("Adding projection: %s", desc)
              proj = Projection(
                  active=False,
                  data=proj_data,
                  desc=desc,
                  kind=FIFF.FIFFV_PROJ_ITEM_FIELD,
                  explained_var=var,
              )
              projs.append(proj)
      return projs
  
imports: import numpy
  from ._fiff.constants import FIFF
  from ._fiff.open import fiff_open
  from ._fiff.pick import _picks_to_idx, pick_types, pick_types_forward
  from ._fiff.proj import Projection, _has_eeg_average_ref_proj, _read_proj, _write_proj, make_eeg_average_ref_proj, make_projector
  from ._fiff.write import start_and_end_file
  from .cov import _check_n_samples
  from .epochs import Epochs
  from .event import make_fixed_length_events
  from .fixes import _safe_svd
  from .forward import _subject_from_forward, convert_forward_solution, is_fixed_orient
  from .parallel import parallel_func
  from .source_estimate import _make_stc
  from .utils import _check_fname, _check_option, _validate_type, check_fname, logger, verbose
label_desc: Use image node_id 3 for calling a global function with example usage: _compute_proj(data, info, n_grad, n_mag, n_eeg, desc_prefix, meg, verbose) and returns: projs