class_docstr: Perturbation of pixels based on analysis result.
  
  :param perturbation_function:
      Defines the function with which the samples are perturbated.
      Can be a function or a string that defines a predefined perturbation function.
  :type perturbation_function:
      function or callable or str
  :param num_perturbed_regions:
      Number of regions to be perturbed.
  :type num_perturbed_regions:
      int
  :param reduce_function:
      Function to reduce the analysis result to one channel,
      e.g. mean or max function.
  :type reduce_function:
      function or callable
  :param aggregation_function:
      Function to aggregate the analysis over subregions.
  :type aggregation_function:
      function or callable
  :param pad_mode:
      How to pad if the image cannot be subdivided into an integer number of regions.
      As in numpy.pad.
  :type pad_mode:
      str or function or callable
  :param in_place:
      If true, the perturbations are performed in place,
      i.e. the input samples are modified.
  :type in_place:
      bool
  :param value_range:
      Minimal and maximal value after perturbation as a tuple:
      (min_val, max_val). The input is clipped to this range
  :type value_range: tuple
code: def _pad(self, analysis):
      pad_shape = (
          self.region_shape
          - np.array(analysis.shape[2:]) % self.region_shape
      )
      assert np.all(pad_shape < self.region_shape)
  
      # Pad half the window before and half after (on h and w axes)
      pad_shape_before = (pad_shape / 2).astype(int)
      pad_shape_after = pad_shape - pad_shape_before
      pad_shape = (
          (0, 0),
          (0, 0),
          (pad_shape_before[0], pad_shape_after[0]),
          (pad_shape_before[1], pad_shape_after[1]),
      )
      analysis = np.pad(analysis, pad_shape, self.pad_mode)
      assert np.all(
          np.array(analysis.shape[2:]) % self.region_shape == 0
      ), analysis.shape[2:]
      return analysis, pad_shape_before
  
imports: from __future__ import annotations
  import time
  import warnings
  import numpy
  import tensorflow.keras.backend
  import tensorflow.keras.utils
  import innvestigate.utils.sequence
label_desc: Use image node_id 6 for calling the Perturbation obj's underlying member method code with example usage: obj._pad(analysis) and returns: analysis,  pad_shape_before