code: def pitch_shift(
      y: np.ndarray,
      *,
      sr: float,
      n_steps: float,
      bins_per_octave: int = 12,
      res_type: str = "soxr_hq",
      scale: bool = False,
      **kwargs: Any,
  ) -> np.ndarray:
      """Shift the pitch of a waveform by ``n_steps`` steps.
  
      A step is equal to a semitone if ``bins_per_octave`` is set to 12.
  
      Parameters
      ----------
      y : np.ndarray [shape=(..., n)]
          audio time series. Multi-channel is supported.
  
      sr : number > 0 [scalar]
          audio sampling rate of ``y``
  
      n_steps : float [scalar]
          how many (fractional) steps to shift ``y``
  
      bins_per_octave : int > 0 [scalar]
          how many steps per octave
  
      res_type : string
          Resample type. By default, 'soxr_hq' is used.
  
          See `librosa.resample` for more information.
  
      scale : bool
          Scale the resampled signal so that ``y`` and ``y_hat`` have approximately
          equal total energy.
  
      **kwargs : additional keyword arguments.
          See `librosa.decompose.stft` for details.
  
      Returns
      -------
      y_shift : np.ndarray [shape=(..., n)]
          The pitch-shifted audio time-series
  
      See Also
      --------
      time_stretch :
          time stretching
      librosa.phase_vocoder :
          spectrogram phase vocoder
      pyrubberband.pyrb.pitch_shift :
          high-quality pitch shifting using RubberBand
  
      Examples
      --------
      Shift up by a major third (four steps if ``bins_per_octave`` is 12)
  
      >>> y, sr = librosa.load(librosa.ex('choice'))
      >>> y_third = librosa.effects.pitch_shift(y, sr=sr, n_steps=4)
  
      Shift down by a tritone (six steps if ``bins_per_octave`` is 12)
  
      >>> y_tritone = librosa.effects.pitch_shift(y, sr=sr, n_steps=-6)
  
      Shift up by 3 quarter-tones
  
      >>> y_three_qt = librosa.effects.pitch_shift(y, sr=sr, n_steps=3,
      ...                                          bins_per_octave=24)
      """
      if not util.is_positive_int(bins_per_octave):
          raise ParameterError(
              f"bins_per_octave={bins_per_octave} must be a positive integer."
          )
  
      rate = 2.0 ** (-float(n_steps) / bins_per_octave)
  
      # Stretch in time, then resample
      y_shift = core.resample(
          time_stretch(y, rate=rate, **kwargs),
          orig_sr=float(sr) / rate,
          target_sr=sr,
          res_type=res_type,
          scale=scale,
      )
  
      # Crop to the same dimension as the input
      return util.fix_length(y_shift, size=y.shape[-1])
  
imports: import numpy
  import scipy.signal
  from .None import core
  from .None import decompose
  from .None import feature
  from .None import util
  from .util.exceptions import ParameterError
  from typing import Any, Callable, Iterable, Optional, Tuple, Union, overload
  from typing_extensions import Literal
  from numpy.typing import ArrayLike
label_desc: Use image node_id 5 for calling a global function with example usage: pitch_shift(y) and returns: util