code: def test_negative_weights(method):
      SP = shortest_path(
          directed_negative_weighted_G, method, directed=True
      )
      assert_allclose(SP, directed_negative_weighted_SP, atol=1e-10)
  
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 15 for calling a global function with example usage: test_negative_weights(method) without return types