code: def test_pagerank_nx(
      graph_file, max_iter, tol, alpha, personalization_perc, has_guess
  ):
      # NetworkX PageRank
      dataset_path = graph_file.get_path()
      M = utils.read_csv_for_nx(dataset_path)
      nnz_vtx = np.unique(M[["0", "1"]])
      Gnx = nx.from_pandas_edgelist(
          M, source="0", target="1", create_using=nx.DiGraph()
      )
  
      networkx_pr, networkx_prsn = networkx_call(
          Gnx, max_iter, tol, alpha, personalization_perc, nnz_vtx
      )
  
      cu_nstart = None
      if has_guess == 1:
          cu_nstart = cudify(networkx_pr)
          max_iter = 20
      cu_prsn = cudify(networkx_prsn)
  
      # cuGraph PageRank with Nx Graph
      cugraph_pr = nx_cugraph_call(
          Gnx, max_iter, tol, alpha, cu_prsn, cu_nstart
      )
  
      # Calculating mismatch
      networkx_pr = sorted(networkx_pr.items(), key=lambda x: x[0])
      cugraph_pr = sorted(cugraph_pr.items(), key=lambda x: x[0])
      err = 0
      assert len(cugraph_pr) == len(networkx_pr)
  
      for i in range(len(cugraph_pr)):
          if (
              abs(cugraph_pr[i][1] - networkx_pr[i][1]) > tol * 1.1
              and cugraph_pr[i][0] == networkx_pr[i][0]
          ):
              err = err + 1
              print(f"{cugraph_pr[i][1]} and {cugraph_pr[i][1]}")
      print("Mismatches:", err)
      assert err < (0.01 * len(cugraph_pr))
  
file_path: cugraph/python/cugraph/cugraph/tests/link_analysis/test_pagerank.py
imports: import gc
  import time
  import pytest
  import numpy
  import networkx
  import cudf
  import cugraph
  from cugraph.testing import utils, DEFAULT_DATASETS
  from cugraph.datasets import karate
label_desc: Use image node_id 7 for calling a global function with example usage: test_pagerank_nx(graph_file, max_iter, tol, alpha, personalization_perc, has_guess) without return types