code: def test_union(jam_fixture):
      D1 = muda.deformers.TimeStretch(rate=[1.0, 2.0, 3.0])
      D2 = muda.deformers.TimeStretch(rate=[0.5, 1.5, 2.5])
  
      rates = [1.0, 0.5, 2.0, 1.5, 3.0, 2.5]
  
      union = muda.Union([("stretch_1", D1), ("stretch_2", D2)])
  
      jam_orig = deepcopy(jam_fixture)
  
      for i, jam_new in enumerate(union.transform(jam_orig)):
          assert jam_new is not jam_orig
          __test_time(jam_orig, jam_fixture, 1.0)
  
          # Verify that the state and history objects are intact
          if i % 2:
              __test_deformer_history(
                  D2, jam_new.sandbox.muda.history[-1]
              )
          else:
              __test_deformer_history(
                  D1, jam_new.sandbox.muda.history[-1]
              )
  
          __test_time(jam_orig, jam_new, rates[i])
  
imports: from copy import deepcopy
  import re
  import six
  import numpy
  import soundfile
  import jams
  import librosa
  import muda
  import pytest
  import scipy
  from contextlib import contextmanager
label_desc: Use image node_id 40 for calling a global function with example usage: test_union(jam_fixture) without return types