code: def _unpad_array(
      arr: np.array,
      pad_width: Union[
          int,
          Sequence[int],
          Sequence[Tuple[int]],
          List[Tuple[int, int]],
      ],
      padded_axes: Sequence[int],
  ):
      """
      Remove padding from the array.
  
      Parameters
      ----------
      arr: np.ndarray
           A numpy array of the input to be unpaded.
      pad_witdh: int, sequence
          The width of the padding for the different dimensions.
      padded_axes: sequence
          The axes for padding.
  
      Returns
      -------
      np.ndarray
          The unpadded array.
  
      """
  
      assert (
          len(padded_axes) <= arr.ndim
      ), "Cannot unpad more axes than array has dimensions"
  
      if isinstance(pad_width, Sequence):
          assert len(pad_width) == len(
              padded_axes
          ), "pad_width and padded_axes have different lengths"
          for p in pad_width:
              if isinstance(p, tuple):
                  assert (
                      len(p) == 2
                  ), "Elements in pad_width need to have length 2"
  
      unpad_slice = []
      for ax in range(arr.ndim):
          if ax not in padded_axes:
              unpad_slice.append(slice(None))
          elif isinstance(pad_width, int):
              unpad_slice.append(
                  slice(pad_width, arr.shape[ax] - pad_width)
              )
          elif isinstance(
              pad_width[[p for p in padded_axes].index(ax)], int
          ):
              unpad_slice.append(
                  slice(
                      pad_width[[p for p in padded_axes].index(ax)],
                      arr.shape[ax]
                      - pad_width[[p for p in padded_axes].index(ax)],
                  )
              )
          else:
              assert isinstance(pad_width, Sequence)
              unpad_slice.append(
                  slice(
                      pad_width[[p for p in padded_axes].index(ax)][0],
                      arr.shape[ax]
                      - pad_width[[p for p in padded_axes].index(ax)][
                          1
                      ],
                  )
              )
  
      unpadded_arr = arr[tuple(unpad_slice)]
      return unpadded_arr
  
imports: import copy
  import re
  from importlib import util
  from typing import Any, Dict, Optional, Sequence, Tuple, Union, List, TypeVar
  import numpy
  from skimage.segmentation import slic, felzenszwalb
  from quantus.helpers import asserts
  from quantus.helpers.model.model_interface import ModelInterface
label_desc: Use image node_id 15 for calling a global function with example usage: _unpad_array(arr, pad_width, padded_axes) and returns: unpadded_arr