code: def sort_index(
      a,
      axis=0,
      level=None,
      ascending=True,
      inplace=False,
      kind="quicksort",
      na_position="last",
      sort_remaining=True,
      ignore_index: bool = False,
      parallel_kind="PSRS",
      psrs_kinds=None,
  ):
      """
      Sort object by labels (along an axis).
  
      Parameters
      ----------
      a : Input DataFrame or Series.
      axis : {0 or 'index', 1 or 'columns'}, default 0
          The axis along which to sort.  The value 0 identifies the rows,
          and 1 identifies the columns.
      level : int or level name or list of ints or list of level names
          If not None, sort on values in specified index level(s).
      ascending : bool, default True
          Sort ascending vs. descending.
      inplace : bool, default False
          If True, perform operation in-place.
      kind : {'quicksort', 'mergesort', 'heapsort'}, default 'quicksort'
          Choice of sorting algorithm. See also ndarray.np.sort for more
          information.  `mergesort` is the only stable algorithm. For
          DataFrames, this option is only applied when sorting on a single
          column or label.
      na_position : {'first', 'last'}, default 'last'
          Puts NaNs at the beginning if `first`; `last` puts NaNs at the end.
          Not implemented for MultiIndex.
      sort_remaining : bool, default True
          If True and sorting by level and index is multilevel, sort by other
          levels too (in order) after sorting by specified level.
      ignore_index : bool, default False
          If True, the resulting axis will be labeled 0, 1, …, n - 1.
      parallel_kind: {'PSRS'}, optional.
          Parallel sorting algorithm, for the details, refer to:
          http://csweb.cs.wfu.edu/bigiron/LittleFE-PSRS/build/html/PSRSalgorithm.html
      psrs_kinds: Sorting algorithms during PSRS algorithm.
  
      Returns
      -------
      sorted_obj : DataFrame or None
          DataFrame with sorted index if inplace=False, None otherwise.
      """
      if na_position not in ["last", "first"]:  # pragma: no cover
          raise TypeError(f"Invalid na_position: {na_position}")
      psrs_kinds = _validate_sort_psrs_kinds(psrs_kinds)
      axis = validate_axis(axis, a)
      level = level if isinstance(level, (list, tuple)) else [level]
      op = DataFrameSortIndex(
          level=level,
          axis=axis,
          ascending=ascending,
          inplace=inplace,
          kind=kind,
          na_position=na_position,
          sort_remaining=sort_remaining,
          ignore_index=ignore_index,
          parallel_kind=parallel_kind,
          psrs_kinds=psrs_kinds,
          gpu=a.op.is_gpu(),
      )
      sorted_a = op(a)
      if inplace:
          a.data = sorted_a.data
      else:
          return sorted_a
  
file_path: mars/mars/dataframe/sort/sort_index.py
imports: import pandas
  from ...None import opcodes
  from ...core import OutputType, recursive_tile
  from ...serialization.serializables import ListField, BoolField
  from ...tensor.base.sort import _validate_sort_psrs_kinds
  from ...utils import calc_nsplits
  from ..utils import parse_index, validate_axis, build_concatenated_rows_frame, standardize_range_index
  from ..operands import DATAFRAME_TYPE
  from .core import DataFrameSortOperand
  from .psrs import DataFramePSRSOperandMixin, execute_sort_index
label_desc: Use image node_id 1 for calling a global function with example usage: sort_index(a, axis, level, ascending, inplace, kind, na_position, sort_remaining, ignore_index, parallel_kind, psrs_kinds) and returns: sorted_a