code: def test_beat(
      ysr,
      hop,
      oenv,
      with_audio,
      with_tempo,
      start_bpm,
      bpm,
      trim,
      tightness,
      prior,
  ):
      y, sr = ysr
  
      if with_audio:
          _y = y
          _ons = None
      else:
          _y = None
          _ons = oenv
  
      tempo, beats = librosa.beat.beat_track(
          y=_y,
          sr=sr,
          onset_envelope=_ons,
          hop_length=hop,
          start_bpm=start_bpm,
          tightness=tightness,
          trim=trim,
          bpm=bpm,
          prior=prior,
      )
  
      assert tempo >= 0
  
      if len(beats) > 0:
          assert beats.min() >= 0
          assert beats.max() <= len(oenv)
  
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 9 for calling a global function with example usage: test_beat(ysr, hop, oenv, with_audio, with_tempo, start_bpm, bpm, trim, tightness, prior) without return types