code: def _temp_proj(ref_2, ref_1, raw_data, n_proj=6):
      # Orthonormalize gradiometer and magnetometer data by a QR decomposition
      ref_1_orth = np.linalg.qr(ref_1.T)[0]
      ref_2_orth = np.linalg.qr(ref_2.T)[0]
  
      # Calculate cross-correlation
      cross_corr = np.dot(ref_1_orth.T, ref_2_orth)
  
      # Channel weights for common temporal subspace by SVD of cross-correlation
      ref_1_ch_weights, _, _ = np.linalg.svd(cross_corr)
  
      # Get temporal signals from channel weights
      proj_mat = ref_1_orth @ ref_1_ch_weights
  
      # Project out common subspace
      filtered_data = raw_data
      proj_vec = proj_mat[:, :n_proj]
      weights = filtered_data @ proj_vec
      filtered_data -= weights @ proj_vec.T
  
imports: import numpy
  from .._fiff.pick import _picks_to_idx
  from ..evoked import Evoked
  from ..utils import _ensure_int, _validate_type, verbose
label_desc: Use image node_id 1 for calling a global function with example usage: _temp_proj(ref_2, ref_1, raw_data, n_proj) without return types