code: def test_griffinlim_cqt(
      y_chirp,
      hop_length,
      window,
      use_length,
      over_sample,
      fmin,
      res_type,
      pad_mode,
      scale,
      momentum,
      init,
      random_state,
      dtype,
  ):
      if use_length:
          length = len(y_chirp)
      else:
          length = None
  
      sr = 22050
      bins_per_octave = 12 * over_sample
      n_bins = 6 * bins_per_octave
      C = librosa.cqt(
          y_chirp,
          sr=sr,
          hop_length=hop_length,
          window=window,
          fmin=fmin,
          bins_per_octave=bins_per_octave,
          n_bins=n_bins,
          scale=scale,
          pad_mode=pad_mode,
          res_type=res_type,
      )
  
      Cmag = np.abs(C)
  
      y_rec = librosa.griffinlim_cqt(
          Cmag,
          hop_length=hop_length,
          window=window,
          sr=sr,
          fmin=fmin,
          bins_per_octave=bins_per_octave,
          scale=scale,
          pad_mode=pad_mode,
          n_iter=2,
          momentum=momentum,
          random_state=random_state,
          length=length,
          res_type=res_type,
          init=init,
          dtype=dtype,
      )
  
      y_inv = librosa.icqt(
          Cmag,
          sr=sr,
          fmin=fmin,
          hop_length=hop_length,
          window=window,
          bins_per_octave=bins_per_octave,
          scale=scale,
          length=length,
          res_type=res_type,
      )
  
      # First check for length
      if use_length:
          assert len(y_rec) == length
  
      assert y_rec.dtype == dtype
  
      # Check that the data is okay
      assert np.all(np.isfinite(y_rec))
  
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 31 for calling a global function with example usage: test_griffinlim_cqt(y_chirp, hop_length, window, use_length, over_sample, fmin, res_type, pad_mode, scale, momentum, init, random_state, dtype) without return types