code: def test_sssp(sg_graph_objs):
      from pylibcugraph import sssp
  
      (g, resource_handle, ds_name) = sg_graph_objs
  
      (
          source,
          expected_verts,
          expected_distances,
          expected_predecessors,
      ) = _test_data[ds_name].values()
  
      cutoff = 999999999  # maximum edge weight sum to consider
      compute_predecessors = True
      do_expensive_check = False
  
      result = sssp(
          resource_handle,
          g,
          source,
          cutoff,
          compute_predecessors,
          do_expensive_check,
      )
  
      num_expected_verts = len(expected_verts)
      (actual_verts, actual_distances, actual_predecessors) = result
  
      # Do a simple check using the vertices as array indices.  First, ensure
      # the test data vertices start from 0 with no gaps.
      assert sum(range(num_expected_verts)) == sum(expected_verts)
  
      assert actual_verts.dtype == expected_verts.dtype
      assert actual_distances.dtype == expected_distances.dtype
      assert actual_predecessors.dtype == expected_predecessors.dtype
  
      actual_verts = actual_verts.tolist()
      actual_distances = actual_distances.tolist()
      actual_predecessors = actual_predecessors.tolist()
      expected_distances = expected_distances.tolist()
      expected_predecessors = expected_predecessors.tolist()
  
      for i in range(num_expected_verts):
          actual_distance = actual_distances[i]
          expected_distance = expected_distances[actual_verts[i]]
          # The distance value will be a MAX value (2**128) if there is no
          # predecessor, so only do a closer compare if either the actual or
          # expected are not that MAX value.
          if (actual_distance <= 3.4e38) or (
              expected_distance <= 3.4e38
          ):
              assert actual_distance == pytest.approx(
                  expected_distance, 1e-4
              ), f"actual != expected for distance result at index {i}"
  
          # The array of predecessors for graphs with multiple paths that are
          # equally short are non-deterministic, so skip those checks for
          # specific graph inputs.
          # FIXME: add a helper to verify paths are correct when results are
          # valid but non-deterministic
          if ds_name not in ["karate.csv", "dolphins.csv"]:
              assert actual_predecessors[i] == pytest.approx(
                  expected_predecessors[actual_verts[i]], 1e-4
              ), f"actual != expected for predecessor result at index {i}"
  
label_desc: Use image node_id 1 for calling a global function with example usage: test_sssp(sg_graph_objs) without return types