code: def rtf_power_numpy(
      psd_s,
      psd_n,
      reference_channel,
      n_iter,
      diagonal_loading=True,
      diag_eps=1e-7,
      eps=1e-8,
  ):
      if diagonal_loading:
          channel = psd_s.shape[-1]
          eye = np.eye(channel)
          trace = np.matrix.trace(psd_n, axis1=1, axis2=2)
          epsilon = trace.real[..., None, None] * diag_eps + eps
          diag = epsilon * eye[..., :, :]
          psd_n = psd_n + diag
      phi = np.linalg.solve(psd_n, psd_s)
      if isinstance(reference_channel, int):
          rtf = phi[..., reference_channel]
      else:
          rtf = phi @ reference_channel
      rtf = np.expand_dims(rtf, -1)
      if n_iter >= 2:
          for _ in range(n_iter - 2):
              rtf = phi @ rtf
          rtf = psd_s @ rtf
      else:
          rtf = psd_n @ rtf
      rtf = rtf.squeeze(-1)
      return rtf
  
imports: import numpy
label_desc: Use image node_id 5 for calling a global function with example usage: rtf_power_numpy(psd_s, psd_n, reference_channel, n_iter, diagonal_loading, diag_eps, eps) and returns: rtf