code: def argsort(
      x: Union[ivy.Array, ivy.NativeArray],
      /,
      *,
      axis: int = -1,
      descending: bool = False,
      stable: bool = True,
      out: Optional[ivy.Array] = None,
  ) -> ivy.Array:
      """Return the indices that sort an array ``x`` along a specified axis.
  
      Parameters
      ----------
      x
          input array.
      axis
          axis along which to sort. If set to ``-1``, the function must sort along the
          last axis. Default: ``-1``.
      descending
          sort order. If ``True``, the returned indices sort ``x`` in descending order
          (by value). If ``False``, the returned indices sort ``x`` in ascending order
          (by value). Default: ``False``.
      stable
          sort stability. If ``True``, the returned indices must maintain the relative
          order of ``x`` values which compare as equal. If ``False``, the returned indices
          may or may not maintain the relative order of ``x`` values which compare as
          equal (i.e., the relative order of ``x`` values which compare as equal is
          implementation-dependent). Default: ``True``.
      out
          optional output array, for writing the result to. It must have the same shape
          as ``x``.
  
      Returns
      -------
      ret
          an array of indices. The returned array must have the same shape as ``x``. The
          returned array must have the default array index data type.
  
  
      This function conforms to the `Array API Standard
      <https://data-apis.org/array-api/latest/>`_. This docstring is an extension of the
      `docstring <https://data-apis.org/array-api/latest/
      API_specification/generated/array_api.argsort.html>`_
      in the standard.
  
      Both the description and the type hints above assumes an array input for simplicity,
      but this function is *nestable*, and therefore also accepts :class:`ivy.Container`
      instances in place of any of the arguments
  
      Examples
      --------
      With :class:`ivy.Array` input:
  
      >>> x = ivy.array([3,1,2])
      >>> y = ivy.argsort(x)
      >>> print(y)
      ivy.array([1,2,0])
  
      >>> x = ivy.array([4,3,8])
      >>> y = ivy.argsort(x, descending=True)
      >>> print(y)
      ivy.array([2,0,1])
  
      >>> x = ivy.array([[1.5, 3.2], [2.3, 2.3]])
      >>> ivy.argsort(x, axis=0, descending=True, stable=False, out=x)
      >>> print(x)
      ivy.array([[1, 0], [0, 1]])
  
      >>> x = ivy.array([[[1,3], [3,2]], [[2,4], [2,0]]])
      >>> y = ivy.argsort(x, axis=1, descending=False, stable=True)
      >>> print(y)
      ivy.array([[[0, 1], [1, 0]], [[0, 1], [1, 0]]])
  
      With :class:`ivy.Container` input:
  
      >>> x = ivy.Container(a=ivy.array([5,1,3]), b=ivy.array([[0, 3], [3, 2]]))
      >>> y = ivy.argsort(x)
      >>> print(y)
      {
          a: ivy.array([1, 2, 0]),
          b: ivy.array([[0, 1], [1, 0]])
      }
  
      >>> x = ivy.Container(a=ivy.array([[3.5, 5],[2.4, 1]]))
      >>> y = ivy.argsort(x)
      >>> print(y)
      {
          a: ivy.array([[0,1],[1,0]])
      }
  
      >>> x = ivy.Container(a=ivy.array([4,3,6]), b=ivy.array([[4, 5], [2, 4]]))
      >>> y = ivy.argsort(x, descending=True)
      >>> print(y)
      {
          a: ivy.array([2, 0, 1]),
          b: ivy.array([[1, 0], [1, 0]])
      }
  
      >>> x = ivy.Container(a=ivy.array([[1.5, 3.2],[2.3, 4]]),
      ...                   b=ivy.array([[[1,3],[3,2],[2,0]]]))
      >>> y = x.argsort(axis=-1, descending=True, stable=False)
      >>> print(y)
      {
          a: ivy.array([[1,0],[1,0]]),
          b: ivy.array([[[1,0],[0, 1],[0, 1]]])
      }
      """
      return ivy.current_backend(x).argsort(
          x, axis=axis, descending=descending, stable=stable, out=out
      )
  
file_path: ivy/ivy/functional/ivy/sorting.py
imports: from typing import Union, Optional, Literal, List
  import ivy
  from ivy.func_wrapper import handle_array_function, to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, handle_device, handle_backend_invalid
  from ivy.utils.exceptions import handle_exceptions
label_desc: Use image node_id 1 for calling a global function with example usage: argsort() and returns: ivy