code: def _generic_katz_test(
      src_arr,
      dst_arr,
      wgt_arr,
      result_arr,
      num_vertices,
      num_edges,
      store_transposed,
      alpha,
      beta,
      epsilon,
      max_iterations,
  ):
      """
      Builds a graph from the input arrays and runs katz using the other args,
      similar to how katz is tested in libcugraph.
      """
      resource_handle = ResourceHandle()
      graph_props = GraphProperties(
          is_symmetric=False, is_multigraph=False
      )
      G = SGGraph(
          resource_handle=resource_handle,
          graph_properties=graph_props,
          src_or_offset_array=src_arr,
          dst_or_index_array=dst_arr,
          weight_array=wgt_arr,
          store_transposed=False,
          renumber=False,
          do_expensive_check=True,
      )
  
      (vertices, centralities) = katz_centrality(
          resource_handle,
          G,
          None,
          alpha,
          beta,
          epsilon,
          max_iterations,
          do_expensive_check=False,
      )
  
      result_arr = result_arr.get()
      vertices = vertices.get()
      centralities = centralities.get()
  
      for idx in range(num_vertices):
          vertex_id = vertices[idx]
          expected_result = result_arr[vertex_id]
          actual_result = centralities[idx]
          if pytest.approx(expected_result, 1e-4) != actual_result:
              raise ValueError(
                  f"Vertex {idx} has centrality {actual_result}"
                  f", should have been {expected_result}"
              )
  
imports: import pytest
  import cupy
  import numpy
  from pylibcugraph import ResourceHandle, GraphProperties, SGGraph, katz_centrality
  from pylibcugraph.testing import utils
label_desc: Use image node_id 2 for calling a global function with example usage: _generic_katz_test(src_arr, dst_arr, wgt_arr, result_arr, num_vertices, num_edges, store_transposed, alpha, beta, epsilon, max_iterations) without return types