code: def _generic_edge_betweenness_centrality_test(
      src_arr,
      dst_arr,
      edge_id_arr,
      result_score_arr,
      result_edge_id_arr,
      num_edges,
      store_transposed,
      k,
      random_state,
      normalized,
  ):
      """
      Builds a graph from the input arrays and runs edge bc using the other args,
      similar to how edge bc is tested in libcugraph.
      """
      resource_handle = ResourceHandle()
      graph_props = GraphProperties(
          is_symmetric=False, is_multigraph=False
      )
      G = SGGraph(
          resource_handle,
          graph_props,
          src_arr,
          dst_arr,
          store_transposed=store_transposed,
          renumber=False,
          do_expensive_check=True,
          edge_id_array=edge_id_arr,
      )
  
      (_, _, values, edge_ids) = edge_betweenness_centrality(
          resource_handle,
          G,
          k,
          random_state,
          normalized,
          do_expensive_check=False,
      )
  
      result_score_arr = result_score_arr.get()
      result_edge_id_arr = result_edge_id_arr.get()
      centralities = values.get()
      edge_ids = edge_ids.get()
  
      for idx in range(num_edges):
          expected_result_score = result_score_arr[idx]
          actual_result_score = centralities[idx]
  
          expected_result_edge_id = result_edge_id_arr[idx]
          actual_result_edge_id = edge_ids[idx]
  
          assert (
              pytest.approx(expected_result_score, 1e-4)
              == actual_result_score
          ), (
              f"Edge {src_arr[idx]} {dst_arr[idx]} has centrality {actual_result_score},"
              f" should have been {expected_result_score}"
          )
  
          assert (
              pytest.approx(expected_result_edge_id, 1e-4)
              == actual_result_edge_id
          ), (
              f"Edge {src_arr[idx]} {dst_arr[idx]} has id {actual_result_edge_id},"
              f" should have been {expected_result_edge_id}"
          )
  
imports: import pytest
  import cupy
  import numpy
  from pylibcugraph import ResourceHandle, GraphProperties, SGGraph, edge_betweenness_centrality
  from pylibcugraph.testing import utils
label_desc: Use image node_id 2 for calling a global function with example usage: _generic_edge_betweenness_centrality_test(src_arr, dst_arr, edge_id_arr, result_score_arr, result_edge_id_arr, num_edges, store_transposed, k, random_state, normalized) without return types