code: def test_diagonal_filter(n, window, angle, slope, zero_mean):
      kernel = librosa.filters.diagonal_filter(
          window, n, slope=slope, angle=angle, zero_mean=zero_mean
      )
  
      # In the no-rotation case, check that the filter is shaped correctly
      if angle == np.pi / 4 and not zero_mean:
          win_unnorm = librosa.filters.get_window(
              window, n, fftbins=False
          )
          win_unnorm /= win_unnorm.sum()
          assert np.allclose(np.diag(kernel), win_unnorm)
  
      # First check: zero-mean
      if zero_mean:
          assert np.isclose(kernel.sum(), 0)
      else:
          assert np.isclose(kernel.sum(), 1) and np.all(kernel >= 0)
  
      # Now check if the angle transposes correctly
      if angle is None:
          # If we're using the slope API, then the transposed kernel
          # will have slope 1/slope
          k2 = librosa.filters.diagonal_filter(
              window,
              n,
              slope=1.0 / slope,
              angle=angle,
              zero_mean=zero_mean,
          )
      else:
          # If we're using the angle API, then the transposed kernel
          # will have angle pi/2 - angle
          k2 = librosa.filters.diagonal_filter(
              window,
              n,
              slope=slope,
              angle=np.pi / 2 - angle,
              zero_mean=zero_mean,
          )
  
      assert np.allclose(k2, kernel.T)
  
imports: import os
  from contextlib import nullcontext
  import warnings
  import glob
  import numpy
  import scipy.io
  import scipy.signal
  from typing import Any, ContextManager
  import pytest
  import librosa
label_desc: Use image node_id 32 for calling a global function with example usage: test_diagonal_filter(n, window, angle, slope, zero_mean) without return types