code: def test_sparse_matrices():
      # Test that using lil,csr and csc sparse matrix do not cause error
      G_dense = np.array(
          [
              [0, 3, 0, 0, 0],
              [0, 0, -1, 0, 0],
              [0, 0, 0, 2, 0],
              [0, 0, 0, 0, 4],
              [0, 0, 0, 0, 0],
          ],
          dtype=float,
      )
      SP = shortest_path(G_dense)
      G_csr = scipy.sparse.csr_matrix(G_dense)
      G_csc = scipy.sparse.csc_matrix(G_dense)
      G_lil = scipy.sparse.lil_matrix(G_dense)
      assert_array_almost_equal(SP, shortest_path(G_csr))
      assert_array_almost_equal(SP, shortest_path(G_csc))
      assert_array_almost_equal(SP, shortest_path(G_lil))
  
imports: from io import StringIO
  import warnings
  import numpy
  from numpy.testing import assert_array_almost_equal, assert_array_equal, assert_allclose
  from pytest import raises
  from scipy.sparse.csgraph import shortest_path, dijkstra, johnson, bellman_ford, construct_dist_matrix, NegativeCycleError
  import scipy.sparse
  from scipy.io import mmread
  import pytest
label_desc: Use image node_id 20 for calling a global function with example usage: test_sparse_matrices() without return types