code: def sort(a, axis=-1, kind=None):
      """Returns a sorted copy of an array with a stable sorting algorithm.
  
      Args:
          a (cupy.ndarray): Array to be sorted.
          axis (int or None): Axis along which to sort. Default is -1, which
              means sort along the last axis. If None is supplied, the array is
              flattened before sorting.
          kind: Default is `None`, which is equivalent to 'stable'. Unlike in
              NumPy any other options are not accepted here.
  
      Returns:
          cupy.ndarray: Array of the same type and shape as ``a``.
  
      .. note::
         For its implementation reason, ``cupy.sort`` currently does not support
         ``kind`` and ``order`` parameters that ``numpy.sort`` does
         support.
  
      .. seealso:: :func:`numpy.sort`
  
      """
      if kind is not None and kind != "stable":
          raise ValueError("kind can only be None or 'stable'")
      if axis is None:
          ret = a.flatten()
          axis = -1
      else:
          ret = a.copy()
      ret.sort(axis=axis)
      return ret
  
file_path: cupy/cupy/_sorting/sort.py
imports: import warnings
  import cupy
  import numpy
  from cupy.cuda import thrust
label_desc: Use image node_id 1 for calling a global function with example usage: sort(a, axis, kind) and returns: ret