code: def test_onset_detect_real(ysr, oenv, hop, bt, normalize):
      y, sr = ysr
      onsets = librosa.onset.onset_detect(
          y=y,
          sr=sr,
          onset_envelope=oenv,
          hop_length=hop,
          backtrack=bt,
          normalize=normalize,
      )
      if bt:
          assert np.all(onsets >= 0)
      else:
          assert np.all(onsets > 0)
  
      assert np.all(onsets < len(y) * sr // hop)
      if oenv is not None:
          assert np.all(onsets < len(oenv))
  
imports: import pytest
  from contextlib import nullcontext
  import os
  import warnings
  import numpy
  import librosa
  from test_core import srand
label_desc: Use image node_id 13 for calling a global function with example usage: test_onset_detect_real(ysr, oenv, hop, bt, normalize) without return types