code: def test_wasserstein_1d(p):
      test_data = np.random.random(size=(10, 100))
      # sparsify
      test_data[test_data <= 0.5] = 0.0
      sparse_test_data = csr_matrix(test_data)
  
      for i in range(test_data.shape[0]):
          for j in range(i + 1, test_data.shape[0]):
              d1 = dist.wasserstein_1d(test_data[i], test_data[j], p)
              d2 = spdist.sparse_wasserstein_1d(
                  sparse_test_data[i].indices,
                  sparse_test_data[i].data,
                  sparse_test_data[j].indices,
                  sparse_test_data[j].data,
                  p,
              )
              assert np.isclose(d1, d2)
  
imports: import pytest
  import numpy
  from numpy.testing import assert_array_equal, assert_array_almost_equal
  import pynndescent.distances
  import pynndescent.sparse
  from scipy import stats
  from scipy.sparse import csr_matrix
  from scipy.version import full_version
  from sklearn.metrics import pairwise_distances
  from sklearn.neighbors import BallTree
  from sklearn.preprocessing import normalize
label_desc: Use image node_id 13 for calling a global function with example usage: test_wasserstein_1d(p) without return types