code: def test_tempo(tempo, sr, hop_length, ac_size, aggregate, prior):
      y = np.zeros(20 * sr)
      delay = librosa.time_to_samples(60.0 / tempo, sr=sr).item()
      y[::delay] = 1
  
      tempo_est = librosa.feature.tempo(
          y=y,
          sr=sr,
          hop_length=hop_length,
          ac_size=ac_size,
          aggregate=aggregate,
          prior=prior,
      )
  
      # Being within 5% for the stable frames is close enough
      if aggregate is None:
          win_size = int(ac_size * sr // hop_length)
          assert np.all(
              np.abs(tempo_est[win_size:-win_size] - tempo)
              <= 0.05 * tempo
          )
      else:
          assert np.abs(tempo_est - tempo) <= 0.05 * tempo, (
              tempo,
              tempo_est,
          )
  
imports: import os
  import pytest
  from contextlib import nullcontext
  import numpy
  import scipy.stats
  import librosa
  from test_core import files, load
label_desc: Use image node_id 3 for calling a global function with example usage: test_tempo(tempo, sr, hop_length, ac_size, aggregate, prior) without return types