code: def invert_labels(labels, classes, copy=False) -> CumlArray:
      """
      Takes a set of labels that have been mapped to be drawn
      from a monotonically increasing set and inverts them to
      back to the original set of classes.
  
      Parameters
      ----------
  
      labels : array-like of size (n,) labels to invert
      classes : array-like of size (n_classes,) the unique set
                of classes for inversion. It is assumed that
                the classes are ordered by their corresponding
                monotonically increasing label.
      copy : boolean if true, a copy will be returned and the
             operation will not be done in place.
  
      Returns
      -------
  
      inverted labels : array-like of size (n,)
  
      """
      labels = input_to_cupy_array(labels, deepcopy=copy).array
      classes = input_to_cupy_array(classes).array
  
      if labels.dtype != classes.dtype:
          raise ValueError(
              "Labels and classes must have same dtype (%s != %s"
              % (labels.dtype, classes.dtype)
          )
      smem = labels.dtype.itemsize * len(classes)
      inverse_map = _inverse_map_kernel(labels.dtype)
      inverse_map(
          (math.ceil(len(labels) / 32),),
          (32,),
          (classes, len(classes), labels, len(labels)),
          shared_mem=smem,
      )
  
      return labels
  
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 6 for calling a global function with example usage: invert_labels(labels, classes, copy) and returns: labels