code: def test_nn_filter_avg():
      srand()
      X = np.random.randn(10, 100)
  
      # Build a recurrence matrix, just for testing purposes
      rec = librosa.segment.recurrence_matrix(X, mode="affinity")
  
      X_filtered = librosa.decompose.nn_filter(
          X, rec=rec, aggregate=np.average
      )
  
      # Normalize the recurrence matrix so dotting computes an average
      rec = librosa.util.normalize(rec, axis=0, norm=1)
  
      assert np.allclose(X_filtered, X.dot(rec))
  
imports: import os
  import numpy
  import scipy.sparse
  import librosa
  import sklearn.decomposition
  import pytest
  from test_core import srand
label_desc: Use image node_id 19 for calling a global function with example usage: test_nn_filter_avg() without return types