code: def normalize(waveforms, lengths=None, amp_type="avg", eps=1e-14):
      """This function normalizes a signal to unitary average or peak amplitude.
  
      Arguments
      ---------
      waveforms : tensor
          The waveforms to normalize.
          Shape should be `[batch, time]` or `[batch, time, channels]`.
      lengths : tensor
          The lengths of the waveforms excluding the padding.
          Shape should be a single dimension, `[batch]`.
      amp_type : str
          Whether one wants to normalize with respect to "avg" or "peak"
          amplitude. Choose between ["avg", "peak"]. Note: for "avg" clipping
          is not prevented and can occur.
      eps : float
          A small number to add to the denominator to prevent NaN.
  
      Returns
      -------
      waveforms : tensor
          Normalized level waveform.
      """
  
      assert amp_type in ["avg", "peak"]
  
      batch_added = False
      if len(waveforms.shape) == 1:
          batch_added = True
          waveforms = waveforms.unsqueeze(0)
  
      den = compute_amplitude(waveforms, lengths, amp_type) + eps
      if batch_added:
          waveforms = waveforms.squeeze(0)
      return waveforms / den
  
file_path: speechbrain/speechbrain/processing/signal_processing.py
imports: import torch
  import math
  from packaging import version
label_desc: Use image node_id 2 for calling a global function with example usage: normalize(waveforms, lengths, amp_type, eps) and returns: unknown