code: def test_colorednoise(
      n_samples, color, weight_min, weight_max, jam_test_silence
  ):
      D = muda.deformers.ColoredNoise(
          n_samples=n_samples,
          color=color,
          weight_min=weight_min,
          weight_max=weight_max,
          rng=0,
      )
      jam_orig = deepcopy(jam_test_silence)
  
      orig_duration = librosa.get_duration(
          **jam_orig.sandbox.muda["_audio"]
      )
  
      n_out = 0
      for jam_new in D.transform(jam_orig):
          assert jam_new is not jam_test_silence
          __test_effect(jam_orig, jam_test_silence)
  
          assert not np.allclose(
              jam_orig.sandbox.muda["_audio"]["y"],
              jam_new.sandbox.muda["_audio"]["y"],
          )
          # verify that duration hasn't changed
          assert (
              librosa.get_duration(**jam_new.sandbox.muda["_audio"])
              == orig_duration
          )
  
          # Verify that the state and history objects are intact
          __test_deformer_history(D, jam_new.sandbox.muda.history[-1])
  
          __test_effect(jam_orig, jam_new)
  
          # Verify the colored noise has desired slope for its log-log
          # scale power spectrum
          color = jam_new.sandbox.muda.history[-1]["state"]["color"]
          __test_color_slope(jam_orig, jam_new, color)
  
          n_out += 1
      assert n_out == n_samples
      # Serialization test
      D2 = muda.deserialize(muda.serialize(D))
      __test_params(D, D2)
  
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 35 for calling a global function with example usage: test_colorednoise(n_samples, color, weight_min, weight_max, jam_test_silence) without return types