code: def add_noise(input_filename, output_filename, noise_vol, noise_type):
      """Add noise to a wav file using sox.
  
      Args:
        input_filename: Path to the original wav file.
        output_filename: Path to the output wav file that will consist of the input
            file plus noise.
        noise_vol: The volume of the noise to add.
        noise_type: One of "whitenoise", "pinknoise", "brownnoise".
  
      Raises:
        ValueError: If `noise_type` is not one of "whitenoise", "pinknoise", or
            "brownnoise".
      """
      if noise_type not in ("whitenoise", "pinknoise", "brownnoise"):
          raise ValueError("invalid noise type: %s" % noise_type)
  
      args = [
          "sox",
          input_filename,
          "-p",
          "synth",
          noise_type,
          "vol",
          str(noise_vol),
          "|",
          "sox",
          "-m",
          input_filename,
          "-",
          output_filename,
      ]
      command = " ".join(args)
      tf.logging.info("Executing: %s", command)
  
      process_handle = subprocess.Popen(
          command,
          stdout=subprocess.PIPE,
          stderr=subprocess.PIPE,
          shell=True,
      )
      process_handle.communicate()
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import math
  import random
  import subprocess
  import tempfile
  from magenta.contrib import training
  import sox
  import tensorflow.compat.v1
label_desc: Use image node_id 3 for calling a global function with example usage: add_noise(input_filename, output_filename, noise_vol, noise_type) without return types