code: def test_neg_inf():
      expected_costs = np.where(a == 1, np.inf, 0)
      expected_path = [
          (1, 6),
          (1, 5),
          (1, 4),
          (1, 3),
          (1, 2),
          (2, 1),
          (3, 1),
          (4, 1),
          (5, 1),
          (6, 1),
      ]
      test_neg = np.where(a == 1, -1, 0)
      test_inf = np.where(a == 1, np.inf, 0)
      with expected_warnings(["Upgrading NumPy" + warning_optional]):
          m = mcp.MCP(test_neg, fully_connected=True)
      costs, traceback = m.find_costs([(1, 6)])
      return_path = m.traceback((6, 1))
      assert_array_equal(costs, expected_costs)
      assert_array_equal(return_path, expected_path)
      with expected_warnings(["Upgrading NumPy" + warning_optional]):
          m = mcp.MCP(test_inf, fully_connected=True)
      costs, traceback = m.find_costs([(1, 6)])
      return_path = m.traceback((6, 1))
      assert_array_equal(costs, expected_costs)
      assert_array_equal(return_path, expected_path)
  
file_path: scikit-image/skimage/graph/tests/test_mcp.py
imports: import numpy
  import skimage.graph.mcp
  from skimage._shared.testing import assert_array_equal, assert_almost_equal, parametrize
  from skimage._shared._warnings import expected_warnings
label_desc: Use image node_id 2 for calling a global function with example usage: test_neg_inf() without return types