code: def test_hits(benchmark, input_expected_output):
      graph_file = input_expected_output["graph_file"]
  
      G = graph_file.get_graph(
          create_using=cugraph.Graph(directed=True)
      )
      cugraph_hits = benchmark(
          cugraph.hits,
          G,
          input_expected_output["max_iter"],
          input_expected_output["tol"],
      )
      cugraph_hits = cugraph_hits.sort_values("vertex").reset_index(
          drop=True
      )
  
      (nx_hubs, nx_authorities) = input_expected_output["nxResults"]
  
      # Update the cugraph HITS results with Nx results for easy comparison using
      # cuDF DataFrame methods.
      pdf = pd.DataFrame.from_dict(nx_hubs, orient="index").sort_index()
      cugraph_hits["nx_hubs"] = cudf.Series.from_pandas(pdf[0])
      pdf = pd.DataFrame.from_dict(
          nx_authorities, orient="index"
      ).sort_index()
      cugraph_hits["nx_authorities"] = cudf.Series.from_pandas(pdf[0])
      hubs_diffs1 = cugraph_hits.query("hubs - nx_hubs > 0.00001")
      hubs_diffs2 = cugraph_hits.query("hubs - nx_hubs < -0.00001")
      authorities_diffs1 = cugraph_hits.query(
          "authorities - nx_authorities > 0.0001"
      )
      authorities_diffs2 = cugraph_hits.query(
          "authorities - nx_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.py
imports: import gc
  import pytest
  import networkx
  import pandas
  import cudf
  import cugraph
  from cugraph.testing import utils, UNDIRECTED_DATASETS
  from cugraph.datasets import email_Eu_core, karate
  from pylibcugraph.testing.utils import gen_fixture_params_product
label_desc: Use image node_id 5 for calling a global function with example usage: test_hits(benchmark, input_expected_output) without return types