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 _expand_regions_to_pixels(self, regions):
      # Resize to pixels (repeat values).
      # (n, c, h_aggregated_region, w_aggregated_region) ->
      # (n, c, h_aggregated_region, h_region, w_aggregated_region, w_region)
      regions_reshaped = np.expand_dims(
          np.expand_dims(regions, axis=3), axis=5
      )
      region_pixels = np.repeat(
          regions_reshaped, self.region_shape[0], axis=3
      )
      region_pixels = np.repeat(
          region_pixels, self.region_shape[1], axis=5
      )
      assert region_pixels.shape[0] == regions.shape[
          0
      ] and region_pixels.shape[2:] == (
          regions.shape[2],
          self.region_shape[0],
          regions.shape[3],
          self.region_shape[1],
      ), region_pixels.shape
  
      return region_pixels
  
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 4 for calling the Perturbation obj's underlying member method code with example usage: obj._expand_regions_to_pixels(regions) and returns: region_pixels