code: def baseline_replacement_by_shift(
      arr: np.array,
      indices: Tuple[
          slice, ...
      ],  # Alt. Union[int, Sequence[int], Tuple[np.array]],
      indexed_axes: Sequence[int],
      input_shift: Union[float, int, str, np.array],
      **kwargs,
  ) -> np.array:
      """
      Shift values at indices in an image.
  
      Parameters
      ----------
          arr: np.ndarray
               Array to be perturbed.
          indices: int, sequence, tuple
              Array-like, with a subset shape of arr.
          indexed_axes: sequence
              The dimensions of arr that are indexed.
              These need to be consecutive, and either include the first or last dimension of array.
          input_shift: float, int, str, np.ndarray
              Value to shift arr at indices with.
          kwargs: optional
              Keyword arguments.
  
      Returns
      -------
      arr_perturbed: np.ndarray
           The array which some of its indices have been perturbed.
      """
  
      indices = expand_indices(arr, indices, indexed_axes)
      baseline_shape = get_leftover_shape(arr, indexed_axes)
  
      arr_perturbed = copy.copy(arr)
  
      # Get the baseline value.
      baseline_value = get_baseline_value(
          value=input_shift,
          arr=arr,
          return_shape=tuple(baseline_shape),
          **kwargs,
      )
  
      # Shift the input.
      arr_shifted = copy.copy(arr_perturbed)
      arr_shifted = np.add(
          arr_shifted,
          np.full(
              shape=arr_shifted.shape,
              fill_value=np.expand_dims(
                  baseline_value, axis=tuple(indexed_axes)
              ),
              dtype=float,
          ),
      )
  
      arr_perturbed[indices] = arr_shifted[indices]
      return arr_perturbed
  
file_path: Quantus/quantus/functions/perturb_func.py
imports: import copy
  import random
  import warnings
  from typing import Any, Callable, Sequence, Tuple, Union, Optional
  import cv2
  import numpy
  from scipy.sparse import lil_matrix, csc_matrix
  from scipy.sparse.linalg import spsolve
  from quantus.helpers.utils import get_baseline_value, blur_at_indices, expand_indices, get_leftover_shape, offset_coordinates
label_desc: Use image node_id 3 for calling a global function with example usage: baseline_replacement_by_shift(arr, indices, indexed_axes, input_shift) and returns: arr_perturbed