code: def get_background_noise(
      len_array: int,
      power_array: float,
      noise_samples: list,
      audio_read_buffer_dict: dict,
      snr_min: float,
      snr_max: float,
      background_noise_snr: float,
      seed: int,
      device: torch.device,
  ):
      """
      Augment with background noise (inserting ambient background noise up to the desired SNR for the full clip).
  
      Args:
          len_array (int): Length of background noise required.
          power_array (float): Power of the audio signal.
          noise_samples (list): List of noise samples.
          audio_read_buffer_dict (dict): Dictionary containing audio read buffer.
          snr_min (float): Minimum SNR.
          snr_max (float): Maximum SNR.
          background_noise_snr (float): SNR of the background noise.
          seed (int): Seed for random number generator.
          device (torch.device): Device to use.
  
      Returns:
          bg_array (tensor): Tensor containing background noise.
          desired_snr (float): Desired SNR for adding background noise.
      """
      np.random.seed(seed)
      bg_array = torch.zeros(len_array).to(device)
      (
          desired_avg_power_noise,
          desired_snr,
      ) = get_desired_avg_power_noise(
          power_array=power_array,
          snr_min=snr_min,
          snr_max=snr_max,
          background_noise_snr=background_noise_snr,
      )
      running_len_samples = 0
  
      while (
          running_len_samples < len_array
      ):  # build background audio stream (the same length as the full file)
          file_id = np.random.randint(len(noise_samples))
          audio_file, sr, audio_manifest = read_audio_from_buffer(
              audio_manifest=noise_samples[file_id],
              buffer_dict=audio_read_buffer_dict,
              offset_index=0,
              device=device,
              read_subset=False,
          )
          if running_len_samples + len(audio_file) < len_array:
              end_audio_file = running_len_samples + len(audio_file)
          else:
              end_audio_file = len_array
          scaled_audio_file = get_scaled_audio_signal(
              audio_file=audio_file,
              end_audio_file=end_audio_file,
              running_len_samples=running_len_samples,
              desired_avg_power_noise=desired_avg_power_noise,
              device=device,
          )
  
          bg_array[
              running_len_samples:end_audio_file
          ] = scaled_audio_file
          running_len_samples = end_audio_file
  
      return bg_array, 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 10 for calling a global function with example usage: get_background_noise(len_array, power_array, noise_samples, audio_read_buffer_dict, snr_min, snr_max, background_noise_snr, seed, device) and returns: bg_array,  desired_snr