code: def make_monotonic(
      labels, classes=None, copy=False
  ) -> typing.Tuple[CumlArray, CumlArray]:
      """
      Takes a set of labels that might not be drawn from the
      set [0, n-1] and renumbers them to be drawn that
      interval.
  
      Replaces labels not present in classes by len(classes)+1.
  
      Parameters
      ----------
  
      labels : array-like of size (n,) labels to convert
      classes : array-like of size (n_classes,) the unique
                set of classes in the set of labels
      copy : boolean if true, a copy will be returned and the
             operation will not be done in place.
  
      Returns
      -------
  
      mapped_labels : array-like of size (n,)
      classes : array-like of size (n_classes,)
      """
      labels = input_to_cupy_array(labels, deepcopy=copy).array
  
      if labels.ndim != 1:
          raise ValueError("Labels array must be 1D")
  
      if classes is None:
          classes = cp.unique(labels)
      else:
          classes = input_to_cupy_array(classes).array
  
      smem = labels.dtype.itemsize * int(classes.shape[0])
  
      map_labels = _map_kernel(labels.dtype)
      map_labels(
          (math.ceil(labels.shape[0] / 32),),
          (32,),
          (labels, labels.shape[0], classes, classes.shape[0]),
          shared_mem=smem,
      )
  
      return labels, classes
  
file_path: cuml/python/cuml/prims/label/classlabels.py
imports: from cuml.common.kernel_utils import cuda_kernel_factory
  from cuml.internals.array import CumlArray
  import cuml.internals
  from cuml.internals.input_utils import input_to_cupy_array
  import math
  import typing
  from cuml.internals.safe_imports import gpu_only_import
label_desc: Use image node_id 4 for calling a global function with example usage: make_monotonic(labels, classes, copy) and returns: labels,  classes