code: def calc_betweenness_centrality(
      graph_file,
      directed=True,
      k=None,
      normalized=False,
      weight=None,
      endpoints=False,
      seed=None,
      result_dtype=np.float64,
      use_k_full=False,
      multi_gpu_batch=False,
      edgevals=False,
  ):
      """Generate both cugraph and networkx betweenness centrality
      Parameters
      ----------
      graph_file : string
          Path to COO Graph representation in .csv format
      directed : bool, optional, default=True
      k : int or None, optional, default=None
          int:  Number of sources  to sample  from
          None: All sources are used to compute
      normalized : bool
          True: Normalize Betweenness Centrality scores
          False: Scores are left unnormalized
      weight : cudf.DataFrame:
          Not supported as of 06/2020
      endpoints : bool
          True: Endpoints are included when computing scores
          False: Endpoints are not considered
      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 'vertex' and  'cu_bc' '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 'vertex', so that we
          can use cupy.isclose to compare the scores.
      """
      G = None
      Gnx = None
  
      if edgevals:
          edge_attr = "weight"
      else:
          edge_attr = None
  
      G = graph_file.get_graph(
          download=True,
          create_using=cugraph.Graph(directed=directed),
          ignore_weights=not edgevals,
      )
  
      M = G.to_pandas_edgelist().rename(
          columns={"src": "0", "dst": "1", "wgt": edge_attr}
      )
  
      Gnx = nx.from_pandas_edgelist(
          M,
          source="0",
          target="1",
          edge_attr=edge_attr,
          create_using=(nx.DiGraph() if directed else nx.Graph()),
      )
  
      assert G is not None and Gnx is not None
      if multi_gpu_batch:
          G.enable_batch()
  
      calc_func = None
      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,
          endpoints=endpoints,
          seed=seed,
          result_dtype=result_dtype,
      )
  
      return sorted_df
  
imports: import gc
  import pytest
  import random
  import numpy
  import networkx
  import cudf
  import cupy
  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_betweenness_centrality(graph_file, directed, k, normalized, weight, endpoints, seed, result_dtype, use_k_full, multi_gpu_batch, edgevals) and returns: sorted_df