code: def calc_katz(graph_file):
      G = graph_file.get_graph(
          create_using=cugraph.Graph(directed=True), ignore_weights=True
      )
  
      degree_max = G.degree()["degree"].max()
      katz_alpha = 1 / (degree_max)
  
      k_df = cugraph.katz_centrality(G, alpha=None, max_iter=1000)
      k_df = k_df.sort_values("vertex").reset_index(drop=True)
  
      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"
      )
      nk = nx.katz_centrality(Gnx, alpha=katz_alpha)
      pdf = [nk[k] for k in sorted(nk.keys())]
      k_df["nx_katz"] = pdf
      k_df = k_df.rename(
          columns={"katz_centrality": "cu_katz"}, copy=False
      )
      return k_df
  
file_path: cugraph/python/cugraph/cugraph/tests/centrality/test_katz_centrality.py
imports: import gc
  import pytest
  import networkx
  import cudf
  import cugraph
  from cugraph.testing import utils, DEFAULT_DATASETS, UNDIRECTED_DATASETS
  from cugraph.datasets import toy_graph_undirected, karate
label_desc: Use image node_id 3 for calling a global function with example usage: calc_katz(graph_file) and returns: k_df