nodes: 0, module; 1, function_definition; 2, function_name:argsort; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, default_parameter; 8, list_splat_pattern; 9, dictionary_splat_pattern; 10, expression_statement; 11, comment:# Implementor note: You have two places to override the behavior of; 12, comment:# argsort.; 13, comment:# 1. _values_for_argsort : construct the values passed to np.argsort; 14, comment:# 2. argsort : total control over sorting.; 15, expression_statement; 16, expression_statement; 17, expression_statement; 18, if_statement; 19, return_statement; 20, identifier:ascending; 21, True; 22, identifier:kind; 23, string; 24, identifier:args; 25, identifier:kwargs; 26, comment:"""
          Return the indices that would sort this array.
  
          Parameters
          ----------
          ascending : bool, default True
              Whether the indices should result in an ascending
              or descending sort.
          kind : {'quicksort', 'mergesort', 'heapsort'}, optional
              Sorting algorithm.
          *args, **kwargs:
              passed through to :func:`numpy.argsort`.
  
          Returns
          -------
          index_array : ndarray
              Array of indices that sort ``self``.
  
          See Also
          --------
          numpy.argsort : Sorting implementation used internally.
          """; 27, assignment; 28, assignment; 29, assignment; 30, not_operator; 31, block; 32, identifier:result; 33, string_content:quicksort; 34, identifier:ascending; 35, call; 36, identifier:values; 37, call; 38, identifier:result; 39, call; 40, identifier:ascending; 41, expression_statement; 42, attribute; 43, argument_list; 44, attribute; 45, argument_list; 46, attribute; 47, argument_list; 48, assignment; 49, identifier:nv; 50, identifier:validate_argsort_with_ascending; 51, identifier:ascending; 52, identifier:args; 53, identifier:kwargs; 54, identifier:self; 55, identifier:_values_for_argsort; 56, identifier:np; 57, identifier:argsort; 58, identifier:values; 59, keyword_argument; 60, dictionary_splat; 61, identifier:result; 62, subscript; 63, identifier:kind; 64, identifier:kind; 65, identifier:kwargs; 66, identifier:result; 67, slice; 68, unary_operator; 69, integer:1
code: def argsort(self, ascending=True, kind='quicksort', *args, **kwargs):
          """
          Return the indices that would sort this array.
  
          Parameters
          ----------
          ascending : bool, default True
              Whether the indices should result in an ascending
              or descending sort.
          kind : {'quicksort', 'mergesort', 'heapsort'}, optional
              Sorting algorithm.
          *args, **kwargs:
              passed through to :func:`numpy.argsort`.
  
          Returns
          -------
          index_array : ndarray
              Array of indices that sort ``self``.
  
          See Also
          --------
          numpy.argsort : Sorting implementation used internally.
          """
          # Implementor note: You have two places to override the behavior of
          # argsort.
          # 1. _values_for_argsort : construct the values passed to np.argsort
          # 2. argsort : total control over sorting.
          ascending = nv.validate_argsort_with_ascending(ascending, args, kwargs)
          values = self._values_for_argsort()
          result = np.argsort(values, kind=kind, **kwargs)
          if not ascending:
              result = result[::-1]
          return result