code: def test_audio_fadeout(
      mono_wave,
      stereo_wave,
      sound_type,
      fps,
      clip_duration,
      fadeout_duration,
  ):
      if sound_type == "stereo":
          make_frame = stereo_wave(left_freq=440, right_freq=160)
      else:
          make_frame = mono_wave(440)
  
      clip = AudioClip(make_frame, duration=clip_duration, fps=fps)
      new_clip = audio_fadeout(clip, fadeout_duration)
  
      fadeout_duration = convert_to_seconds(fadeout_duration)
  
      n_parts = 10
  
      # cut transformed part into subclips and check the expected max_volume for
      # each one
      time_foreach_part = fadeout_duration / n_parts
      start_times = np.arange(
          clip_duration - fadeout_duration,
          clip_duration,
          time_foreach_part,
      )
      for i, start_time in enumerate(start_times):
          end_time = start_time + time_foreach_part
          subclip_max_volume = new_clip.subclip(
              start_time, end_time
          ).max_volume()
  
          possible_value = 1 - i * 0.1
          assert round(subclip_max_volume, 2) in [
              round(possible_value, 2),
              round(possible_value - 0.01, 5),
          ]
  
      # cut non transformed part into subclips and check the expected max_volume
      # for each one (almost 1)
      time_foreach_part = (clip_duration - fadeout_duration) / n_parts
      start_times = np.arange(
          0, clip_duration - fadeout_duration, time_foreach_part
      )
      for i, start_time in enumerate(start_times):
          end_time = start_time + time_foreach_part
          subclip_max_volume = new_clip.subclip(
              start_time, end_time
          ).max_volume()
  
          assert round(subclip_max_volume, 4) == 1
  
imports: import decimal
  import importlib
  import math
  import numbers
  import os
  import random
  import sys
  import numpy
  import pytest
  from moviepy import AudioClip, AudioFileClip, BitmapClip, ColorClip, VideoClip, VideoFileClip
  from moviepy.audio.fx import audio_delay, audio_fadein, audio_fadeout, audio_normalize, multiply_stereo_volume, multiply_volume
  from moviepy.tools import convert_to_seconds
  from moviepy.video.fx import blackwhite, crop, even_size, fadein, fadeout, freeze, freeze_region, invert_colors, loop, lum_contrast, make_loopable, margin, mask_and, mask_or, mirror_x, mirror_y, multiply_color, multiply_speed, resize, rotate, time_mirror, time_symmetrize
label_desc: Use image node_id 40 for calling a global function with example usage: test_audio_fadeout(mono_wave, stereo_wave, sound_type, fps, clip_duration, fadeout_duration) without return types