code: def test_exactly_one_transform_applied(self):
      samples = np.array([0.25, 0.0, 0.1, -0.4], dtype=np.float32)
      sample_rate = 44100
  
      for _ in range(30):
          augmenter = OneOf(
              [
                  Gain(min_gain_db=-12, max_gain_db=-6, p=1.0),
                  PolarityInversion(p=1.0),
              ]
          )
          perturbed_samples = augmenter(
              samples=samples, sample_rate=sample_rate
          )
  
          was_gain_applied = 0.0 < abs(perturbed_samples[0]) < 0.25
          was_polarity_inversion_applied = perturbed_samples[0] < 0.0
  
          num_transforms_applied = sum(
              [
                  1 if was_gain_applied else 0,
                  1 if was_polarity_inversion_applied else 0,
              ]
          )
          assert num_transforms_applied == 1
  
file_path: audiomentations/tests/test_one_of.py
imports: import os
  import numpy
  from numpy.testing import assert_array_equal, assert_array_almost_equal
  from audiomentations import ClippingDistortion, AddBackgroundNoise, TimeMask, Shift, PolarityInversion, Gain, SpecFrequencyMask, OneOf
  from demo.demo import DEMO_DIR
label_desc: Use image node_id 1 for calling the TestOneOf obj's underlying member method code with example usage: obj.test_exactly_one_transform_applied() without return types