code: def argsort(a, axis=-1, kind="quicksort", order=None):
      """
      Returns the indices that would sort an array.
  
      Perform an indirect sort along the given axis using the algorithm
      specified by the kind keyword.  It returns an array of indices of
      the same shape as a that index data along the given axis in sorted
      order.
  
      """
      if axis is None:
          a = a.flatten()
          axis = 0
      return ArgSortOp(kind, order)(a, axis)
  
imports: import numpy
  from pytensor.gradient import grad_undefined
  from pytensor.graph.basic import Apply, Constant
  from pytensor.graph.op import Op
  from pytensor.misc.safe_asarray import _asarray
  from pytensor.tensor.basic import arange, as_tensor_variable, flatten, switch
  from pytensor.tensor.math import eq, ge, mul
  from pytensor.tensor.shape import shape
  from pytensor.tensor.subtensor import set_subtensor
  from pytensor.tensor.type import TensorType, integer_dtypes
label_desc: Use image node_id 4 for calling a global function with example usage: argsort(a, axis, kind, order) and returns: ArgSortOp