code: def series_sort_values(
      series,
      axis=0,
      ascending=True,
      inplace=False,
      kind="quicksort",
      na_position="last",
      ignore_index=False,
      parallel_kind="PSRS",
      psrs_kinds=None,
  ):
      """
      Sort by the values.
  
      Sort a Series in ascending or descending order by some
      criterion.
  
      Parameters
      ----------
      series : input Series.
      axis : {0 or 'index'}, default 0
          Axis to direct sorting. The value 'index' is accepted for
          compatibility with DataFrame.sort_values.
      ascending : bool, default True
          If True, sort values in ascending order, otherwise descending.
      inplace : bool, default False
          If True, perform operation in-place.
      kind : {'quicksort', 'mergesort' or 'heapsort'}, default 'quicksort'
          Choice of sorting algorithm. See also :func:`numpy.sort` for more
          information. 'mergesort' is the only stable  algorithm.
      na_position : {'first' or 'last'}, default 'last'
          Argument 'first' puts NaNs at the beginning, 'last' puts NaNs at
          the end.
      ignore_index : bool, default False
           If True, the resulting axis will be labeled 0, 1, …, n - 1.
  
      Returns
      -------
      Series
          Series ordered by values.
  
      Examples
      --------
      >>> import mars.dataframe as md
      >>> raw = pd.Series([np.nan, 1, 3, 10, 5])
      >>> s = md.Series(raw)
      >>> s.execute()
      0     NaN
      1     1.0
      2     3.0
      3     10.0
      4     5.0
      dtype: float64
  
      Sort values ascending order (default behaviour)
  
      >>> s.sort_values(ascending=True).execute()
      1     1.0
      2     3.0
      4     5.0
      3    10.0
      0     NaN
      dtype: float64
  
      Sort values descending order
  
      >>> s.sort_values(ascending=False).execute()
      3    10.0
      4     5.0
      2     3.0
      1     1.0
      0     NaN
      dtype: float64
  
      Sort values inplace
  
      >>> s.sort_values(ascending=False, inplace=True)
      >>> s.execute()
      3    10.0
      4     5.0
      2     3.0
      1     1.0
      0     NaN
      dtype: float64
  
      Sort values putting NAs first
      """
      if na_position not in ["last", "first"]:  # pragma: no cover
          raise TypeError(f"invalid na_position: {na_position}")
      axis = validate_axis(axis, series)
      if axis != 0:
          raise NotImplementedError("Only support sort on axis 0")
      psrs_kinds = _validate_sort_psrs_kinds(psrs_kinds)
      op = DataFrameSortValues(
          axis=axis,
          ascending=ascending,
          inplace=inplace,
          kind=kind,
          na_position=na_position,
          ignore_index=ignore_index,
          parallel_kind=parallel_kind,
          psrs_kinds=psrs_kinds,
          output_types=[OutputType.series],
          gpu=series.op.is_gpu(),
      )
      sorted_series = op(series)
      if inplace:
          series.data = sorted_series.data
      else:
          return sorted_series
  
imports: import numpy
  import pandas
  from ...None import opcodes
  from ...core import OutputType
  from ...serialization.serializables import ListField
  from ...tensor.base.sort import _validate_sort_psrs_kinds
  from ..utils import parse_index, validate_axis, build_concatenated_rows_frame
  from ..core import IndexValue
  from .core import DataFrameSortOperand
  from .psrs import DataFramePSRSOperandMixin, execute_sort_values
label_desc: Use image node_id 2 for calling a global function with example usage: series_sort_values(series, axis, ascending, inplace, kind, na_position, ignore_index, parallel_kind, psrs_kinds) and returns: sorted_series