code: def cugraph_call(
      gpu_benchmark_callable, input_G_or_matrix, source, edgevals=True
  ):
      """
      Call cugraph.sssp on input_G_or_matrix, then convert the result to a
      standard format (dictionary of vertex IDs to (distance, predecessor)
      tuples) for easy checking in the test code.
      """
      result = gpu_benchmark_callable(
          cugraph.sssp, input_G_or_matrix, source
      )
  
      input_type = type(input_G_or_matrix)
      expected_return_type = cuGraph_input_output_map[
          type(input_G_or_matrix)
      ]
      assert type(result) is expected_return_type
  
      # Convert cudf and pandas: DF of 3 columns: (vertex, distance, predecessor)
      if expected_return_type in [cudf.DataFrame, pd.DataFrame]:
          if expected_return_type is pd.DataFrame:
              result = cudf.from_pandas(result)
  
          if np.issubdtype(result["distance"].dtype, np.integer):
              max_val = np.iinfo(result["distance"].dtype).max
          else:
              max_val = np.finfo(result["distance"].dtype).max
          verts = result["vertex"].to_numpy()
          dists = result["distance"].to_numpy()
          preds = result["predecessor"].to_numpy()
  
      # A CuPy/SciPy input means the return value will be a 2-tuple of:
      #   distance: cupy.ndarray
      #      ndarray of shortest distances between source and vertex.
      #   predecessor: cupy.ndarray
      #      ndarray of predecessors of a vertex on the path from source, which
      #      can be used to reconstruct the shortest paths.
      elif expected_return_type is tuple:
          if input_type in cupy_types:
              assert type(result[0]) is cp.ndarray
              assert type(result[1]) is cp.ndarray
          else:
              assert type(result[0]) is np.ndarray
              assert type(result[1]) is np.ndarray
  
          if np.issubdtype(result[0].dtype, np.integer):
              max_val = np.iinfo(result[0].dtype).max
          else:
              max_val = np.finfo(result[0].dtype).max
  
          # Get unique verts from input since they are not incuded in output
          if type(input_G_or_matrix) in [
              cp_csr_matrix,
              cp_csc_matrix,
              sp_csr_matrix,
              sp_csc_matrix,
          ]:
              coo = input_G_or_matrix.tocoo(copy=False)
          else:
              coo = input_G_or_matrix
          verts = sorted(
              set(
                  [n.item() for n in coo.col]
                  + [n.item() for n in coo.row]
              )
          )
          dists = [n.item() for n in result[0]]
          preds = [n.item() for n in result[1]]
          assert len(verts) == len(dists) == len(preds)
  
      else:
          raise RuntimeError(
              f"unsupported return type: {expected_return_type}"
          )
  
      result_dict = dict(zip(verts, zip(dists, preds)))
      return result_dict, max_val
  
imports: import gc
  import pytest
  import numpy
  import pandas
  import cudf
  import cupyx
  import cugraph
  import cupy
  from cupyx.scipy.sparse import coo_matrix
  from cupyx.scipy.sparse import csr_matrix
  from cupyx.scipy.sparse import csc_matrix
  from scipy.sparse import coo_matrix
  from scipy.sparse import csr_matrix
  from scipy.sparse import csc_matrix
  from pylibcugraph.testing.utils import gen_fixture_params_product
  from cugraph.testing import utils, get_resultset, load_resultset, UNDIRECTED_DATASETS, SMALL_DATASETS
label_desc: Use image node_id 2 for calling a global function with example usage: cugraph_call(gpu_benchmark_callable, input_G_or_matrix, source, edgevals) and returns: result_dict,  max_val