code: def test_onset_detect_const(y, sr, hop_length):
      # Disable padding here
      onsets = librosa.onset.onset_detect(
          y=y,
          sr=sr,
          onset_envelope=None,
          hop_length=hop_length,
      )
  
      # We'll allow one onset at the start of the signal for these examples
      # when y is all-ones, zero-padding induces an onset at the beginning of the
      # signal
      assert len(onsets) == 0 or (y[0] != 0 and len(onsets) == 1)
  
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 15 for calling a global function with example usage: test_onset_detect_const(y, sr, hop_length) without return types