class_docstr: Time stretch the signal without changing the pitch
code: def apply(self, samples: NDArray[np.float32], sample_rate: int):
      try:
          time_stretched_samples = librosa.effects.time_stretch(
              samples, rate=self.parameters["rate"]
          )
      except librosa.util.exceptions.ParameterError:
          # In librosa<0.9.0 time_stretch doesn't natively support multichannel audio.
          # Here we use a workaround that simply loops over the channels instead.
          # TODO: Remove this workaround when we remove support for librosa<0.9.0
          time_stretched_channels = []
          for i in range(samples.shape[0]):
              time_stretched_samples = librosa.effects.time_stretch(
                  samples[i], rate=self.parameters["rate"]
              )
              time_stretched_channels.append(time_stretched_samples)
          time_stretched_samples = np.array(
              time_stretched_channels, dtype=samples.dtype
          )
  
      if self.leave_length_unchanged:
          # Apply zero padding if the time stretched audio is not long enough to fill the
          # whole space, or crop the time stretched audio if it ended up too long.
          padded_samples = np.zeros(
              shape=samples.shape, dtype=samples.dtype
          )
          window = time_stretched_samples[..., : samples.shape[-1]]
          actual_window_length = window.shape[
              -1
          ]  # may be smaller than samples.shape[-1]
          padded_samples[..., :actual_window_length] = window
          time_stretched_samples = padded_samples
      return time_stretched_samples
  
file_path: audiomentations/audiomentations/augmentations/time_stretch.py
imports: import random
  import librosa
  import numpy
  from numpy.typing import NDArray
  from audiomentations.core.transforms_interface import BaseWaveformTransform
label_desc: Use image node_id 3 for calling the TimeStretch obj's underlying member method code with example usage: obj.apply(samples, sample_rate) and returns: time_stretched_samples