@call_decorator<EOL><INDENT>def __call__(self, input_or_adv, label=None, unpack=True,<EOL>max_pixels=<NUM_LIT:1000>):<DEDENT>
a = input_or_adv<EOL>del input_or_adv<EOL>del label<EOL>del unpack<EOL>channel_axis = a.channel_axis(batch=False)<EOL>image = a.original_image<EOL>axes = [i for i in range(image.ndim) if i != channel_axis]<EOL>assert len(axes) == <NUM_LIT:2><EOL>h = image.shape[axes[<NUM_LIT:0>]]<EOL>w = image.shape[axes[<NUM_LIT:1>]]<EOL>min_, max_ = a.bounds()<EOL>pixels = nprng.permutation(h * w)<EOL>pixels = pixels[:max_pixels]<EOL>for i, pixel in enumerate(pixels):<EOL><INDENT>x = pixel % w<EOL>y = pixel // w<EOL>location = [x, y]<EOL>location.insert(channel_axis, slice(None))<EOL>location = tuple(location)<EOL>for value in [min_, max_]:<EOL><INDENT>perturbed = image.copy()<EOL>perturbed[location] = value<EOL>_, is_adv = a.predictions(perturbed)<EOL>if is_adv:<EOL><INDENT>return<EOL><DEDENT><DEDENT><DEDENT>
Perturbs just a single pixel and sets it to the min or max.

        Parameters
        ----------
        input_or_adv : `numpy.ndarray` or :class:`Adversarial`
            The original, correctly classified image. If image is a
            numpy array, label must be passed as well. If image is
            an :class:`Adversarial` instance, label must not be passed.
        label : int
            The reference label of the original image. Must be passed
            if image is a numpy array, must not be passed if image is
            an :class:`Adversarial` instance.
        unpack : bool
            If true, returns the adversarial image, otherwise returns
            the Adversarial object.
        max_pixels : int
            Maximum number of pixels to try.