code: def _weighted_sum(sample_score, sample_weight, normalize):
      if normalize:
          return cp.average(sample_score, weights=sample_weight)
      elif sample_weight is not None:
          return cp.dot(sample_score, sample_weight)
      else:
          return sample_score.sum()
  
imports: from cuml.internals.input_utils import input_to_cupy_array
  import cuml.internals
  from cuml.internals.safe_imports import cpu_only_import
  from cuml.internals.safe_imports import gpu_only_import
label_desc: Use image node_id 2 for calling a global function with example usage: _weighted_sum(sample_score, sample_weight, normalize) and returns: cp, cp, sample_score