code: def norm_epsilon_inf(
      G, R, phi, l1_ratio, n_orient, w_space=None, w_time=None
  ):
      """Weighted epsilon-inf norm of phi(np.dot(G.T, R)).
  
      Parameters
      ----------
      G : array, shape (n_sensors, n_sources)
          Gain matrix a.k.a. lead field.
      R : array, shape (n_sensors, n_times)
          Residual.
      phi : instance of _Phi
          The TF operator.
      l1_ratio : float between 0 and 1
          Parameter controlling the tradeoff between L21 and L1 regularization.
          0 corresponds to an absence of temporal regularization, ie MxNE.
      n_orient : int
          Number of dipoles per location (typically 1 or 3).
      w_space : array, shape (n_positions,) or None.
          Weights for the L2 term of the epsilon norm. If None, weights are
          all equal to 1.
      w_time : array, shape (n_positions, n_coefs) or None
          Weights for the L1 term of the epsilon norm. If None, weights are
          all equal to 1.
  
      Returns
      -------
      nu : float
          The maximum value of the epsilon norms over groups of n_orient dipoles
          (consecutive rows of phi(np.dot(G.T, R))).
      """
      n_positions = G.shape[1] // n_orient
      GTRPhi = np.abs(phi(np.dot(G.T, R)))
      # norm over orientations:
      GTRPhi = GTRPhi.reshape((n_orient, -1), order="F")
      GTRPhi = np.linalg.norm(GTRPhi, axis=0)
      GTRPhi = GTRPhi.reshape((n_positions, -1), order="F")
      nu = 0.0
      for idx in range(n_positions):
          GTRPhi_ = GTRPhi[idx]
          w_t = w_time[idx] if w_time is not None else None
          w_s = w_space[idx] if w_space is not None else 1.0
          norm_eps = norm_epsilon(
              GTRPhi_, l1_ratio, phi, w_space=w_s, w_time=w_t
          )
          if norm_eps > nu:
              nu = norm_eps
  
      return nu
  
imports: import functools
  from math import sqrt
  import numpy
  from ..time_frequency._stft import istft, stft, stft_norm1, stft_norm2
  from ..utils import _check_option, _get_blas_funcs, _validate_type, logger, sum_squared, verbose, warn
  from .mxne_debiasing import compute_bias
label_desc: Use image node_id 18 for calling a global function with example usage: norm_epsilon_inf(G, R, phi, l1_ratio, n_orient, w_space, w_time) and returns: nu