code: def _group_same_scores(sorted_score):
      mask = cp.empty(sorted_score.shape, dtype=cp.bool_)
      mask[0] = True
      mask[1:] = sorted_score[1:] != sorted_score[:-1]
      group = cp.cumsum(mask, dtype=cp.int32)
      return group
  
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 6 for calling a global function with example usage: _group_same_scores(sorted_score) and returns: group