code: def _calculate_area_under_curve(fpr, tpr):
      """helper function to calculate area under curve given fpr & tpr arrays"""
      return (
          cp.sum((fpr[1:] - fpr[:-1]) * (tpr[1:] + tpr[:-1])) / 2
          + tpr[0] * fpr[0] / 2
      )
  
file_path: cuml/python/cuml/metrics/_ranking.py
imports: import math
  from cuml.internals.input_utils import input_to_cupy_array
  from cuml.internals.array import CumlArray
  import cuml.internals
  from cuml.internals.safe_imports import cpu_only_import
  import typing
  from cuml.internals.safe_imports import gpu_only_import
label_desc: Use image node_id 7 for calling a global function with example usage: _calculate_area_under_curve(fpr, tpr) and returns: unknown