parameters: (
          self,
          return_indexer=False,
          ascending=True,
          na_position="last",
          key=None,
      )
docstring: Return a sorted copy of the index, and optionally return the indices
          that sorted the index itself.
  
          Parameters
          ----------
          return_indexer : bool, default False
              Should the indices that would sort the index be returned.
          ascending : bool, default True
              Should the index values be sorted in an ascending order.
          na_position : {'first' or 'last'}, default 'last'
              Argument 'first' puts NaNs at the beginning, 'last' puts NaNs at
              the end.
          key : None, optional
              This parameter is NON-FUNCTIONAL.
  
          Returns
          -------
          sorted_index : Index
              Sorted copy of the index.
          indexer : cupy.ndarray, optional
              The indices that the index itself was sorted by.
  
          See Also
          --------
          cudf.Series.min : Sort values of a Series.
          cudf.DataFrame.sort_values : Sort values in a DataFrame.
  
          Examples
          --------
          >>> import cudf
          >>> idx = cudf.Index([10, 100, 1, 1000])
          >>> idx
          Int64Index([10, 100, 1, 1000], dtype='int64')
  
          Sort values in ascending order (default behavior).
  
          >>> idx.sort_values()
          Int64Index([1, 10, 100, 1000], dtype='int64')
  
          Sort values in descending order, and also get the indices `idx` was
          sorted by.
  
          >>> idx.sort_values(ascending=False, return_indexer=True)
          (Int64Index([1000, 100, 10, 1], dtype='int64'), array([3, 1, 0, 2],
                                                              dtype=int32))
  
          Sorting values in a MultiIndex:
  
          >>> midx = cudf.MultiIndex(
          ...      levels=[[1, 3, 4, -10], [1, 11, 5]],
          ...      codes=[[0, 0, 1, 2, 3], [0, 2, 1, 1, 0]],
          ...      names=["x", "y"],
          ... )
          >>> midx
          MultiIndex([(  1,  1),
                      (  1,  5),
                      (  3, 11),
                      (  4, 11),
                      (-10,  1)],
                     names=['x', 'y'])
          >>> midx.sort_values()
          MultiIndex([(-10,  1),
                      (  1,  1),
                      (  1,  5),
                      (  3, 11),
                      (  4, 11)],
                     names=['x', 'y'])
          >>> midx.sort_values(ascending=False)
          MultiIndex([(  4, 11),
                      (  3, 11),
                      (  1,  5),
                      (  1,  1),
                      (-10,  1)],
                     names=['x', 'y'])
docstring_summary: Return a sorted copy of the index, and optionally return the indices
          that sorted the index itself.
docstring_tokens: Return a sorted copy of the index and optionally return the indices that sorted the index itself .
function: def sort_values(
          self,
          return_indexer=False,
          ascending=True,
          na_position="last",
          key=None,
      ):
          """
          Return a sorted copy of the index, and optionally return the indices
          that sorted the index itself.
  
          Parameters
          ----------
          return_indexer : bool, default False
              Should the indices that would sort the index be returned.
          ascending : bool, default True
              Should the index values be sorted in an ascending order.
          na_position : {'first' or 'last'}, default 'last'
              Argument 'first' puts NaNs at the beginning, 'last' puts NaNs at
              the end.
          key : None, optional
              This parameter is NON-FUNCTIONAL.
  
          Returns
          -------
          sorted_index : Index
              Sorted copy of the index.
          indexer : cupy.ndarray, optional
              The indices that the index itself was sorted by.
  
          See Also
          --------
          cudf.Series.min : Sort values of a Series.
          cudf.DataFrame.sort_values : Sort values in a DataFrame.
  
          Examples
          --------
          >>> import cudf
          >>> idx = cudf.Index([10, 100, 1, 1000])
          >>> idx
          Int64Index([10, 100, 1, 1000], dtype='int64')
  
          Sort values in ascending order (default behavior).
  
          >>> idx.sort_values()
          Int64Index([1, 10, 100, 1000], dtype='int64')
  
          Sort values in descending order, and also get the indices `idx` was
          sorted by.
  
          >>> idx.sort_values(ascending=False, return_indexer=True)
          (Int64Index([1000, 100, 10, 1], dtype='int64'), array([3, 1, 0, 2],
                                                              dtype=int32))
  
          Sorting values in a MultiIndex:
  
          >>> midx = cudf.MultiIndex(
          ...      levels=[[1, 3, 4, -10], [1, 11, 5]],
          ...      codes=[[0, 0, 1, 2, 3], [0, 2, 1, 1, 0]],
          ...      names=["x", "y"],
          ... )
          >>> midx
          MultiIndex([(  1,  1),
                      (  1,  5),
                      (  3, 11),
                      (  4, 11),
                      (-10,  1)],
                     names=['x', 'y'])
          >>> midx.sort_values()
          MultiIndex([(-10,  1),
                      (  1,  1),
                      (  1,  5),
                      (  3, 11),
                      (  4, 11)],
                     names=['x', 'y'])
          >>> midx.sort_values(ascending=False)
          MultiIndex([(  4, 11),
                      (  3, 11),
                      (  1,  5),
                      (  1,  1),
                      (-10,  1)],
                     names=['x', 'y'])
          """
          if key is not None:
              raise NotImplementedError("key parameter is not yet implemented.")
          if na_position not in {"first", "last"}:
              raise ValueError(f"invalid na_position: {na_position}")
  
          indices = self.argsort(ascending=ascending, na_position=na_position)
          index_sorted = self.take(indices)
  
          if return_indexer:
              return index_sorted, indices
          else:
              return index_sorted
function_tokens: def sort_values ( self , return_indexer = False , ascending = True , na_position = "last" , key = None , ) : if key is not None : raise NotImplementedError ( "key parameter is not yet implemented." ) if na_position not in { "first" , "last" } : raise ValueError ( f"invalid na_position: {na_position}" ) indices = self . argsort ( ascending = ascending , na_position = na_position ) index_sorted = self . take ( indices ) if return_indexer : return index_sorted , indices else : return index_sorted