code: def test_dask_mg_hits(dask_client, benchmark, input_expected_output):
      dg = input_expected_output["MGGraph"]
  
      result_hits = benchmark(
          dcg.hits,
          dg,
          input_expected_output["tol"],
          input_expected_output["max_iter"],
      )
  
      result_hits = (
          result_hits.compute()
          .sort_values("vertex")
          .reset_index(drop=True)
          .rename(
              columns={
                  "hubs": "mg_cugraph_hubs",
                  "authorities": "mg_cugraph_authorities",
              }
          )
      )
  
      expected_output = (
          input_expected_output["sg_cugraph_results"]
          .sort_values("vertex")
          .reset_index(drop=True)
      )
  
      # Update the dask cugraph HITS results with sg cugraph results for easy
      # comparison using cuDF DataFrame methods.
      result_hits["sg_cugraph_hubs"] = expected_output["hubs"]
      result_hits["sg_cugraph_authorities"] = expected_output[
          "authorities"
      ]
  
      hubs_diffs1 = result_hits.query(
          "mg_cugraph_hubs - sg_cugraph_hubs > 0.00001"
      )
      hubs_diffs2 = result_hits.query(
          "mg_cugraph_hubs - sg_cugraph_hubs < -0.00001"
      )
      authorities_diffs1 = result_hits.query(
          "mg_cugraph_authorities - sg_cugraph_authorities > 0.0001"
      )
      authorities_diffs2 = result_hits.query(
          "mg_cugraph_authorities - sg_cugraph_authorities < -0.0001"
      )
  
      assert len(hubs_diffs1) == 0
      assert len(hubs_diffs2) == 0
      assert len(authorities_diffs1) == 0
      assert len(authorities_diffs2) == 0
  
file_path: cugraph/python/cugraph/cugraph/tests/link_analysis/test_hits_mg.py
imports: import gc
  import pytest
  import dask_cudf
  import cugraph
  import cugraph.dask
  from cugraph.testing import utils
  from pylibcugraph.testing.utils import gen_fixture_params_product
label_desc: Use image node_id 4 for calling a global function with example usage: test_dask_mg_hits(dask_client, benchmark, input_expected_output) without return types