code: def time_stretch(
      y: np.ndarray, *, rate: float, **kwargs: Any
  ) -> np.ndarray:
      """Time-stretch an audio series by a fixed rate.
  
      Parameters
      ----------
      y : np.ndarray [shape=(..., n)]
          audio time series. Multi-channel is supported.
      rate : float > 0 [scalar]
          Stretch factor.  If ``rate > 1``, then the signal is sped up.
          If ``rate < 1``, then the signal is slowed down.
      **kwargs : additional keyword arguments.
          See `librosa.decompose.stft` for details.
  
      Returns
      -------
      y_stretch : np.ndarray [shape=(..., round(n/rate))]
          audio time series stretched by the specified rate
  
      See Also
      --------
      pitch_shift :
          pitch shifting
      librosa.phase_vocoder :
          spectrogram phase vocoder
      pyrubberband.pyrb.time_stretch :
          high-quality time stretching using RubberBand
  
      Examples
      --------
      Compress to be twice as fast
  
      >>> y, sr = librosa.load(librosa.ex('choice'))
      >>> y_fast = librosa.effects.time_stretch(y, rate=2.0)
  
      Or half the original speed
  
      >>> y_slow = librosa.effects.time_stretch(y, rate=0.5)
      """
      if rate <= 0:
          raise ParameterError("rate must be a positive number")
  
      # Construct the short-term Fourier transform (STFT)
      stft = core.stft(y, **kwargs)
  
      # Stretch by phase vocoding
      stft_stretch = core.phase_vocoder(
          stft,
          rate=rate,
          hop_length=kwargs.get("hop_length", None),
          n_fft=kwargs.get("n_fft", None),
      )
  
      # Predict the length of y_stretch
      len_stretch = int(round(y.shape[-1] / rate))
  
      # Invert the STFT
      y_stretch = core.istft(
          stft_stretch, dtype=y.dtype, length=len_stretch, **kwargs
      )
  
      return y_stretch
  
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 4 for calling a global function with example usage: time_stretch(y) and returns: y_stretch