class_docstr: This attack was originally implemented by Vargas et al. (2019). It is generalisation of One Pixel Attack originally
  implemented by Su et al. (2019).
  
  | One Pixel Attack Paper link: https://arxiv.org/abs/1710.08864
  | Pixel Attack Paper link: https://arxiv.org/abs/1906.06026
docstr: Perturbs the given image `img` with the given perturbation `x`.
docstr_tok: ["Perturbs","the","given","image","`","img","`","with","the","given","perturbation","`","x","`","."]
code: def _perturb_image(
      self, x: np.ndarray, img: np.ndarray
  ) -> np.ndarray:
      """
      Perturbs the given image `img` with the given perturbation `x`.
      """
      if x.ndim < 2:
          x = np.array([x])
      imgs = np.tile(img, [len(x)] + [1] * (x.ndim + 1))
      x = x.astype(int)
      for adv, image in zip(x, imgs):
          for pixel in np.split(
              adv, len(adv) // (2 + self.img_channels)
          ):
              x_pos, y_pos, *rgb = pixel
              if not self.estimator.channels_first:
                  image[
                      x_pos % self.img_rows, y_pos % self.img_cols
                  ] = rgb
              else:
                  image[
                      :, x_pos % self.img_rows, y_pos % self.img_cols
                  ] = rgb
      return imgs
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  from itertools import product
  from typing import List, Optional, Tuple, TYPE_CHECKING
  import numpy
  from six import string_types
  import scipy
  from scipy._lib._util import check_random_state
  from scipy.optimize import OptimizeResult, minimize
  from tqdm.auto import tqdm
  from art.config import ART_NUMPY_DTYPE
  from art.attacks.attack import EvasionAttack
  from art.estimators.estimator import BaseEstimator, NeuralNetworkMixin
  from art.estimators.classification.classifier import ClassifierMixin
  from art.utils import check_and_transform_label_format
label_desc: Use image node_id 2 for calling the PixelAttack obj's underlying member method code with example usage: obj._perturb_image(x, img) and returns: imgs