code: def test_nn_filter_mean_rec():
      srand()
      X = np.random.randn(10, 100)
  
      # Build a recurrence matrix, just for testing purposes
      rec = librosa.segment.recurrence_matrix(X)
  
      # Knock out the first three rows of links
      rec[:, :3] = False
  
      X_filtered = librosa.decompose.nn_filter(X, rec=rec)
  
      for i in range(3):
          assert np.allclose(X_filtered[:, i], X[:, i])
  
      # Normalize the recurrence matrix
      rec = librosa.util.normalize(rec.astype(float), axis=0, norm=1)
      assert np.allclose(X_filtered[:, 3:], (X.dot(rec))[:, 3:])
  
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 15 for calling a global function with example usage: test_nn_filter_mean_rec() without return types