class_docstr: SomeOf randomly picks several of the given transforms when called, and applies these
  transforms. The number of transforms to apply can be chosen in two different ways:
  
      - Pick exactly n transforms:
          Example:    # pick exactly two of the transforms
                      SomeOf(2, [transform1, transform2, transform3])
  
      - Pick between a minimum and maximum number of transforms.
          Examples:   # pick 1 to 3 of the transforms
                      SomeOf((1, 3), [transform1, transform2, transform3])
  
                      # pick 2 to all of the transforms
                      SomeOf((2, None), [transform1, transform2, transform3, transform4])
  
  Usage example:
  ```
  augment = SomeOf(
      (2, None),
      [
          TimeStretch(min_rate=0.8, max_rate=1.25, p=1.0),
          PitchShift(min_semitones=-4, max_semitones=4, p=1.0),
          Gain(min_gain_in_db=-12, max_gain_in_db=-6, p=1.0),
      ],
  )
  
  # Generate 2 seconds of dummy audio for the sake of example
  samples = np.random.uniform(low=-0.2, high=0.2, size=(32000,)).astype(np.float32)
  
  # Augment/transform/perturb the audio data
  augmented_samples = augment(samples=samples, sample_rate=16000)
  
  # Result: 2 or more transforms will be applied from the list of transforms.
  ```
class_docstr_tok: ["SomeOf","randomly","picks","several","of","the","given","transforms","when","called",",","and","applies","these","transforms",".","The","number","of","transforms","to","apply","can","be","chosen","in","two","different","ways",":","-","Pick","exactly","n","transforms",":","Example",":","#","pick","exactly","two","of","the","transforms","SomeOf","(","2",",","[","transform1",",","transform2",",","transform3","]",")","-","Pick","between","a","minimum","and","maximum","number","of","transforms",".","Examples",":","#","pick","1","to","3","of","the","transforms","SomeOf","(","(","1",",","3",")",",","[","transform1",",","transform2",",","transform3","]",")","#","pick","2","to","all","of","the","transforms","SomeOf","(","(","2",",","None",")",",","[","transform1",",","transform2",",","transform3",",","transform4","]",")","Usage","example",":","``","`","augment","=","SomeOf","(","(","2",",","None",")",",","[","TimeStretch","(","min_rate=0.8",",","max_rate=1.25",",","p=1.0",")",",","PitchShift","(","min_semitones=-4",",","max_semitones=4",",","p=1.0",")",",","Gain","(","min_gain_in_db=-12",",","max_gain_in_db=-6",",","p=1.0",")",",","]",",",")","#","Generate","2","seconds","of","dummy","audio","for","the","sake","of","example","samples","=","np.random.uniform","(","low=-0.2",",","high=0.2",",","size=","(","32000",",",")",")",".astype","(","np.float32",")","#","Augment\/transform\/perturb","the","audio","data","augmented_samples","=","augment","(","samples=samples",",","sample_rate=16000",")","#","Result",":","2","or","more","transforms","will","be","applied","from","the","list","of","transforms",".","``","`"]
code: def __call__(self, *args, **kwargs):
      if not self.are_parameters_frozen:
          kwargs["apply_to_children"] = False
          self.randomize_parameters(*args, **kwargs)
  
      if self.should_apply:
          if "apply_to_children" in kwargs:
              del kwargs["apply_to_children"]
  
          if issubclass(
              type(self.transforms[0]), BaseSpectrogramTransform
          ):
              if "magnitude_spectrogram" in kwargs:
                  magnitude_spectrogram = kwargs[
                      "magnitude_spectrogram"
                  ]
              else:
                  magnitude_spectrogram = args[0]
  
              for transform_index in self.transform_indexes:
                  magnitude_spectrogram = self.transforms[
                      transform_index
                  ](magnitude_spectrogram)
  
              return magnitude_spectrogram
          else:  # The transforms are subclasses of BaseWaveformTransform
              if "sample_rate" in kwargs:
                  samples = (
                      kwargs["samples"]
                      if "samples" in kwargs
                      else args[0]
                  )
                  sample_rate = kwargs["sample_rate"]
              else:
                  samples = args[0]
                  sample_rate = args[1]
  
              for transform_index in self.transform_indexes:
                  samples = self.transforms[transform_index](
                      samples, sample_rate
                  )
  
              return samples
  
      if "samples" in kwargs:
          return kwargs["samples"]
      elif "magnitude_spectrogram" in kwargs:
          return kwargs["magnitude_spectrogram"]
      else:
          return args[0]
  
imports: import random
  import numpy
  from numpy.typing import NDArray
  from audiomentations.core.transforms_interface import BaseSpectrogramTransform
label_desc: Use image node_id 3 for calling the SomeOf obj's underlying member method code with example usage: obj.__call__() and returns: kwargs, magnitude_spectrogram, samples, kwargs, args