code: def l2_prox(tensor, regularizer):
      """
      Proximal operator of (regularizer*|| ||_2) (l2 norm).
  
      This proximal operator is sometimes called block soft thresholding.
  
      Parameters
      ----------
      tensor : ndarray
      regularizer : float
  
      Returns
      -------
      ndarray
  
      Notes
      -----
      .. math::
          \\begin{equation}
              prox_{\\gamma} ||x||_2 = (1 - \\gamma / \\max(|x||_2, \\gamma ))\\times x
          \\end{equation}
      """
      norm = tl.norm(tensor)
      if norm > regularizer:
          bigger_value = norm
      else:
          bigger_value = regularizer
      return tensor - (tensor * regularizer / bigger_value)
  
file_path: tensorly/tensorly/tenalg/proximal.py
imports: import tensorly
  import numpy
label_desc: Use image node_id 7 for calling a global function with example usage: l2_prox(tensor, regularizer) and returns: unknown