code: def add_point_source_noise(
      noise_addition_descriptor,  # descriptor to store the information of the noise added
      room,  # the room selected
      pointsource_noise_list,  # the point source noise list
      pointsource_noise_addition_probability,  # Probability of adding point-source noises
      foreground_snrs,  # the SNR for adding the foreground noises
      background_snrs,  # the SNR for adding the background noises
      speech_dur,  # duration of the recording
      max_noises_recording,  # Maximum number of point-source noises that can be added
  ):
      if (
          len(pointsource_noise_list) > 0
          and random.random() < pointsource_noise_addition_probability
          and max_noises_recording >= 1
      ):
          for k in range(random.randint(1, max_noises_recording)):
              # pick the RIR to reverberate the point-source noise
              noise = pick_item_with_probability(pointsource_noise_list)
              noise_rir = pick_item_with_probability(room.rir_list)
              # If it is a background noise, the noise will be extended and be added to the whole speech
              # if it is a foreground noise, the noise will not extended and be added at a random time of the speech
              if noise.bg_fg_type == "background":
                  noise_rvb_command = """wav-reverberate --impulse-response="{0}" --duration={1}""".format(
                      noise_rir.rir_rspecifier, speech_dur
                  )
                  noise_addition_descriptor["start_times"].append(0)
                  noise_addition_descriptor["snrs"].append(
                      next(background_snrs)
                  )
              else:
                  noise_rvb_command = """wav-reverberate --impulse-response="{0}" """.format(
                      noise_rir.rir_rspecifier
                  )
                  noise_addition_descriptor["start_times"].append(
                      round(random.random() * speech_dur, 2)
                  )
                  noise_addition_descriptor["snrs"].append(
                      next(foreground_snrs)
                  )
  
              # check if the rspecifier is a pipe or not
              if len(noise.noise_rspecifier.split()) == 1:
                  noise_addition_descriptor["noise_io"].append(
                      "{1} {0} - |".format(
                          noise.noise_rspecifier, noise_rvb_command
                      )
                  )
              else:
                  noise_addition_descriptor["noise_io"].append(
                      "{0} {1} - - |".format(
                          noise.noise_rspecifier, noise_rvb_command
                      )
                  )
  
      return noise_addition_descriptor
  
imports: import argparse, shlex, glob, math, os, random, sys, warnings, copy, imp, ast
label_desc: Use image node_id 7 for calling a global function with example usage: add_point_source_noise(noise_addition_descriptor, room, pointsource_noise_list, pointsource_noise_addition_probability, foreground_snrs, background_snrs, speech_dur, max_noises_recording) and returns: noise_addition_descriptor