code: def remix(
      y: np.ndarray,
      intervals: Iterable[Tuple[int, int]],
      *,
      align_zeros: bool = True,
  ) -> np.ndarray:
      """Remix an audio signal by re-ordering time intervals.
  
      Parameters
      ----------
      y : np.ndarray [shape=(..., t)]
          Audio time series. Multi-channel is supported.
      intervals : iterable of tuples (start, end)
          An iterable (list-like or generator) where the ``i``th item
          ``intervals[i]`` indicates the start and end (in samples)
          of a slice of ``y``.
      align_zeros : boolean
          If ``True``, interval boundaries are mapped to the closest
          zero-crossing in ``y``.  If ``y`` is stereo, zero-crossings
          are computed after converting to mono.
  
      Returns
      -------
      y_remix : np.ndarray [shape=(..., d)]
          ``y`` remixed in the order specified by ``intervals``
  
      Examples
      --------
      Load in the example track and reverse the beats
  
      >>> y, sr = librosa.load(librosa.ex('choice'))
  
      Compute beats
  
      >>> _, beat_frames = librosa.beat.beat_track(y=y, sr=sr,
      ...                                          hop_length=512)
  
      Convert from frames to sample indices
  
      >>> beat_samples = librosa.frames_to_samples(beat_frames)
  
      Generate intervals from consecutive events
  
      >>> intervals = librosa.util.frame(beat_samples, frame_length=2,
      ...                                hop_length=1).T
  
      Reverse the beat intervals
  
      >>> y_out = librosa.effects.remix(y, intervals[::-1])
      """
      y_out = []
  
      if align_zeros:
          y_mono = core.to_mono(y)
          zeros = np.nonzero(core.zero_crossings(y_mono))[-1]
          # Force end-of-signal onto zeros
          zeros = np.append(zeros, [len(y_mono)])
  
      for interval in intervals:
          if align_zeros:
              interval = zeros[util.match_events(interval, zeros)]
  
          y_out.append(y[..., interval[0] : interval[1]])
  
      return np.concatenate(y_out, axis=-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 6 for calling a global function with example usage: remix(y, intervals) and returns: np