@call_decorator<EOL><INDENT>def __call__(self, input_or_adv, label=None, unpack=True,<EOL>epsilons=<NUM_LIT:100>, repetitions=<NUM_LIT:10>):<DEDENT>
a = input_or_adv<EOL>del input_or_adv<EOL>del label<EOL>del unpack<EOL>image = a.original_image<EOL>min_, max_ = a.bounds()<EOL>axis = a.channel_axis(batch=False)<EOL>channels = image.shape[axis]<EOL>shape = list(image.shape)<EOL>shape[axis] = <NUM_LIT:1><EOL>r = max_ - min_<EOL>pixels = np.prod(shape)<EOL>epsilons = min(epsilons, pixels)<EOL>max_epsilon = <NUM_LIT:1><EOL>for _ in range(repetitions):<EOL><INDENT>for epsilon in np.linspace(<NUM_LIT:0>, max_epsilon, num=epsilons + <NUM_LIT:1>)[<NUM_LIT:1>:]:<EOL><INDENT>p = epsilon<EOL>u = nprng.uniform(size=shape)<EOL>u = u.repeat(channels, axis=axis)<EOL>salt = (u >= <NUM_LIT:1> - p / <NUM_LIT:2>).astype(image.dtype) * r<EOL>pepper = -(u < p / <NUM_LIT:2>).astype(image.dtype) * r<EOL>perturbed = image + salt + pepper<EOL>perturbed = np.clip(perturbed, min_, max_)<EOL>if a.normalized_distance(perturbed) >= a.distance:<EOL><INDENT>continue<EOL><DEDENT>_, is_adversarial = a.predictions(perturbed)<EOL>if is_adversarial:<EOL><INDENT>max_epsilon = min(<NUM_LIT:1>, epsilon * <NUM_LIT>)<EOL>break<EOL><DEDENT><DEDENT><DEDENT>
Increases the amount of salt and pepper noise until the
        image is misclassified.

        Parameters
        ----------
        input_or_adv : `numpy.ndarray` or :class:`Adversarial`
            The original, unperturbed input as a `numpy.ndarray` or
            an :class:`Adversarial` instance.
        label : int
            The reference label of the original input. Must be passed
            if `a` is a `numpy.ndarray`, must not be passed if `a` is
            an :class:`Adversarial` instance.
        unpack : bool
            If true, returns the adversarial input, otherwise returns
            the Adversarial object.
        epsilons : int
            Number of steps to try between probability 0 and 1.
        repetitions : int
            Specifies how often the attack will be repeated.