code: def pad_center(
      data: np.ndarray, *, size: int, axis: int = -1, **kwargs: Any
  ) -> np.ndarray:
      """Pad an array to a target length along a target axis.
  
      This differs from `np.pad` by centering the data prior to padding,
      analogous to `str.center`
  
      Examples
      --------
      >>> # Generate a vector
      >>> data = np.ones(5)
      >>> librosa.util.pad_center(data, size=10, mode='constant')
      array([ 0.,  0.,  1.,  1.,  1.,  1.,  1.,  0.,  0.,  0.])
  
      >>> # Pad a matrix along its first dimension
      >>> data = np.ones((3, 5))
      >>> librosa.util.pad_center(data, size=7, axis=0)
      array([[ 0.,  0.,  0.,  0.,  0.],
             [ 0.,  0.,  0.,  0.,  0.],
             [ 1.,  1.,  1.,  1.,  1.],
             [ 1.,  1.,  1.,  1.,  1.],
             [ 1.,  1.,  1.,  1.,  1.],
             [ 0.,  0.,  0.,  0.,  0.],
             [ 0.,  0.,  0.,  0.,  0.]])
      >>> # Or its second dimension
      >>> librosa.util.pad_center(data, size=7, axis=1)
      array([[ 0.,  1.,  1.,  1.,  1.,  1.,  0.],
             [ 0.,  1.,  1.,  1.,  1.,  1.,  0.],
             [ 0.,  1.,  1.,  1.,  1.,  1.,  0.]])
  
      Parameters
      ----------
      data : np.ndarray
          Vector to be padded and centered
      size : int >= len(data) [scalar]
          Length to pad ``data``
      axis : int
          Axis along which to pad and center the data
      **kwargs : additional keyword arguments
          arguments passed to `np.pad`
  
      Returns
      -------
      data_padded : np.ndarray
          ``data`` centered and padded to length ``size`` along the
          specified axis
  
      Raises
      ------
      ParameterError
          If ``size < data.shape[axis]``
  
      See Also
      --------
      numpy.pad
      """
      kwargs.setdefault("mode", "constant")
  
      n = data.shape[axis]
  
      lpad = int((size - n) // 2)
  
      lengths = [(0, 0)] * data.ndim
      lengths[axis] = (lpad, int(size - n - lpad))
  
      if lpad < 0:
          raise ParameterError(
              f"Target size ({size:d}) must be at least input size ({n:d})"
          )
  
      return np.pad(data, lengths, **kwargs)
  
imports: from __future__ import annotations
  import scipy.ndimage
  import scipy.sparse
  import numpy
  import numba
  from numpy.lib.stride_tricks import as_strided
  from .._cache import cache
  from .exceptions import ParameterError
  from .deprecation import Deprecated
  from numpy.typing import ArrayLike, DTypeLike
  from typing import Any, Callable, Iterable, List, Dict, Optional, Sequence, Tuple, TypeVar, Union, overload
  from typing_extensions import Literal
  from .._typing import _SequenceLike, _FloatLike_co, _ComplexLike_co
label_desc: Use image node_id 6 for calling a global function with example usage: pad_center(data) and returns: np