code: def average_over_durations_test():  # pylint: disable=no-self-use
      pitch = T.rand(1, 1, 128)
  
      durations = T.randint(1, 5, (1, 21))
      coeff = 128.0 / durations.sum()
      durations = T.floor(durations * coeff)
      diff = 128.0 - durations.sum()
      durations[0, -1] += diff
      durations = durations.long()
  
      pitch_avg = average_over_durations(pitch, durations)
  
      index = 0
      for idx, dur in enumerate(durations[0]):
          assert (
              abs(
                  pitch_avg[0, 0, idx]
                  - pitch[0, 0, index : index + dur.item()].mean()
              )
              < 1e-5
          )
          index += dur
  
imports: import torch
  from TTS.tts.utils.helpers import average_over_durations, generate_path, rand_segments, segment, sequence_mask
label_desc: Use image node_id 1 for calling a global function with example usage: average_over_durations_test() without return types