code: def get_desired_avg_power_noise(
      power_array: float,
      snr_min: float,
      snr_max: float,
      background_noise_snr: float,
  ):
      """
      Calculate the desired average power of the noise.
  
      Args:
          power_array (float): Power of the audio signal.
          snr_min (float): Minimum SNR.
          snr_max (float): Maximum SNR.
          background_noise_snr (float): SNR of the background noise.
  
      Returns:
          desired_avg_power_noise (float): Desired average power of the noise.
      """
      if (
          (snr_min is not None)
          and (snr_max is not None)
          and (snr_min <= snr_max)
      ):
          desired_snr = np.random.uniform(snr_min, snr_max)
      else:
          desired_snr = background_noise_snr
      ratio = 10 ** (desired_snr / 20)
      desired_avg_power_noise = power_array / ratio
      return desired_avg_power_noise, desired_snr
  
imports: import copy
  import os
  import shutil
  from collections import defaultdict
  from typing import IO, Dict, List, Optional, Tuple
  import numpy
  import torch
  from scipy.stats import beta, gamma
  from tqdm import tqdm
  from nemo.collections.asr.parts.preprocessing.perturb import AudioAugmentor
  from nemo.collections.asr.parts.preprocessing.segment import AudioSegment
  from nemo.collections.asr.parts.utils.manifest_utils import get_ctm_line, read_manifest, write_ctm, write_manifest, write_text
  from nemo.collections.asr.parts.utils.speaker_utils import labels_to_rttmfile
  from nemo.utils import logging
label_desc: Use image node_id 9 for calling a global function with example usage: get_desired_avg_power_noise(power_array, snr_min, snr_max, background_noise_snr) and returns: desired_avg_power_noise,  desired_snr