code: def test_degree_centrality_nx(graph_file):
      dataset_path = graph_file.get_path()
      NM = utils.read_csv_for_nx(dataset_path)
      Gnx = nx.from_pandas_edgelist(
          NM,
          create_using=nx.DiGraph(),
          source="0",
          target="1",
      )
  
      G = cugraph.utilities.convert_from_nx(Gnx)
  
      nk = nx.degree_centrality(Gnx)
      ck = cugraph.degree_centrality(G)
  
      # Calculating mismatch
      nk = sorted(nk.items(), key=lambda x: x[0])
      ck = ck.sort_values("vertex")
      ck.index = ck["vertex"]
      ck = ck["degree_centrality"]
      err = 0
  
      assert len(ck) == len(nk)
      for i in range(len(ck)):
          if abs(ck[i] - nk[i][1]) > 0.1 and ck.index[i] == nk[i][0]:
              err = err + 1
      print("Mismatches:", err)
      assert err < (0.1 * len(ck))
  
file_path: cugraph/python/cugraph/cugraph/tests/centrality/test_degree_centrality.py
imports: import gc
  import pytest
  import networkx
  import cudf
  import cugraph
  from cugraph.testing import utils, UNDIRECTED_DATASETS
label_desc: Use image node_id 3 for calling a global function with example usage: test_degree_centrality_nx(graph_file) without return types