code: def test_cqt_position(y, sr, note_min: int):
      C = (
          np.abs(
              librosa.cqt(
                  y, sr=sr, fmin=float(librosa.midi_to_hz(note_min))
              )
          )
          ** 2
      )
  
      # Average over time
      Cbar = np.median(C, axis=1)
  
      # Find the peak
      idx = int(np.argmax(Cbar))
  
      assert idx == 60 - note_min
  
      # Make sure that the max outside the peak is sufficiently small
      Cscale = Cbar / Cbar[idx]
      Cscale[idx] = np.nan
      assert np.nanmax(Cscale) < 6e-1, Cscale
  
      Cscale[idx - 1 : idx + 2] = np.nan
      assert np.nanmax(Cscale) < 5e-2, Cscale
  
imports: from __future__ import division
  import warnings
  import os
  from typing import Optional
  import librosa
  import numpy
  import scipy.stats
  import pytest
  from test_core import srand
label_desc: Use image node_id 16 for calling a global function with example usage: test_cqt_position(y, sr, note_min) without return types