class_docstr: The elastic net attack of Pin-Yu Chen et al. (2018).
  
  | Paper link: https://arxiv.org/abs/1709.04114
docstr: Implement the element-wise projected shrinkage-threshold function.
  
  :param z_batch: A batch of examples.
  :param x_batch: A batch of original examples.
  :param beta: The shrink parameter.
  :return: A shrinked version of z.
docstr_tok: ["Implement","the","element-wise","projected","shrinkage-threshold","function",".",":","param","z_batch",":","A","batch","of","examples",".",":","param","x_batch",":","A","batch","of","original","examples",".",":","param","beta",":","The","shrink","parameter",".",":","return",":","A","shrinked","version","of","z","."]
code: def _shrinkage_threshold(
      z_batch: np.ndarray, x_batch: np.ndarray, beta: float
  ) -> np.ndarray:
      """
      Implement the element-wise projected shrinkage-threshold function.
  
      :param z_batch: A batch of examples.
      :param x_batch: A batch of original examples.
      :param beta: The shrink parameter.
      :return: A shrinked version of z.
      """
      cond1 = (z_batch - x_batch) > beta
      cond2 = np.abs(z_batch - x_batch) <= beta
      cond3 = (z_batch - x_batch) < -beta
  
      upper = np.minimum(z_batch - beta, 1.0)
      lower = np.maximum(z_batch + beta, 0.0)
      result = cond1 * upper + cond2 * x_batch + cond3 * lower
  
      return result
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  from typing import Optional, Tuple, TYPE_CHECKING
  import numpy
  import six
  from tqdm.auto import trange
  from art.config import ART_NUMPY_DTYPE
  from art.attacks.attack import EvasionAttack
  from art.estimators.estimator import BaseEstimator
  from art.estimators.classification.classifier import ClassGradientsMixin
  from art.utils import compute_success, get_labels_np_array, check_and_transform_label_format
label_desc: Use image node_id 9 for calling the ElasticNet obj's underlying member method code with example usage: obj._shrinkage_threshold(z_batch, x_batch, beta) and returns: result