code: def test_lag_to_recurrence_sparse(axis, pad):
      srand()
      data = np.random.randn(3, 10)
      rec = librosa.segment.recurrence_matrix(data, sparse=True)
      lag = librosa.segment.recurrence_to_lag(rec, pad=pad, axis=axis)
  
      lag_dense = lag.toarray()
  
      rec_sparse = librosa.segment.lag_to_recurrence(lag, axis=axis)
      rec_dense = librosa.segment.lag_to_recurrence(
          lag_dense, axis=axis
      )
  
      assert scipy.sparse.issparse(rec_sparse)
      assert rec_sparse.format == lag.format
      assert rec_sparse.dtype == lag.dtype
      assert np.allclose(rec_sparse.toarray(), rec_dense)
  
imports: from typing import Union
  import warnings
  import os
  import numpy
  import scipy
  from scipy.spatial.distance import cdist, pdist, squareform
  import pytest
  from test_core import srand
  import librosa
label_desc: Use image node_id 30 for calling a global function with example usage: test_lag_to_recurrence_sparse(axis, pad) without return types