code: def calc_edge_betweenness_centrality(
      graph_file,
      directed=True,
      k=None,
      normalized=False,
      weight=None,
      seed=None,
      result_dtype=np.float64,
      use_k_full=False,
      multi_gpu_batch=False,
      edgevals=False,
  ):
      """Generate both cugraph and networkx edge betweenness centrality
  
      Parameters
      ----------
      graph_file : string
          Path to COO Graph representation in .csv format
  
      k : int or None, optional, default=None
          int:  Number of sources  to sample  from
          None: All sources are used to compute
  
      directed : bool, optional, default=True
  
      normalized : bool
          True: Normalize Betweenness Centrality scores
          False: Scores are left unnormalized
  
      weight : cudf.DataFrame:
          Not supported as of 06/2020
  
      seed : int or None, optional, default=None
          Seed for random sampling  of the starting point
  
      result_dtype :  numpy.dtype
          Expected type of the result, either np.float32 or np.float64
  
      use_k_full : bool
          When True, if k is None replaces k by the number of sources of the
          Graph
  
      multi_gpu_batch: bool
          When True, enable mg batch after constructing the graph
  
      edgevals: bool
          When True, enable tests with weighted graph, should be ignored
          during computation.
  
      Returns
      -------
  
      sorted_df : cudf.DataFrame
          Contains 'src', 'dst', 'cu_bc' and 'ref_bc' columns,  where 'cu_bc'
          and 'ref_bc' are the two betweenness centrality scores to compare.
          The dataframe is expected to be sorted based on 'src' then 'dst',
          so that we can use cupy.isclose to compare the scores.
      """
      G = None
      Gnx = None
      dataset_path = graph_file.get_path()
      Gnx = utils.generate_nx_graph_from_file(
          dataset_path, directed=directed, edgevals=edgevals
      )
  
      G = graph_file.get_graph(
          create_using=cugraph.Graph(directed=directed),
          ignore_weights=not edgevals,
      )
  
      assert G is not None and Gnx is not None
      if multi_gpu_batch:
          G.enable_batch()
  
      if k is not None and seed is not None:
          calc_func = _calc_bc_subset
      elif k is not None:
          calc_func = _calc_bc_subset_fixed
      else:  # We processed to a comparison using every sources
          if use_k_full:
              k = Gnx.number_of_nodes()
          calc_func = _calc_bc_full
      sorted_df = calc_func(
          G,
          Gnx,
          k=k,
          normalized=normalized,
          weight=weight,
          seed=seed,
          result_dtype=result_dtype,
      )
  
      return sorted_df
  
imports: import gc
  import pytest
  import random
  import networkx
  import numpy
  import cupy
  import cudf
  import cugraph
  from cugraph.datasets import karate_disjoint
  from cugraph.testing import utils, SMALL_DATASETS
label_desc: Use image node_id 2 for calling a global function with example usage: calc_edge_betweenness_centrality(graph_file, directed, k, normalized, weight, seed, result_dtype, use_k_full, multi_gpu_batch, edgevals) and returns: sorted_df