nodes: 0, module; 1, function_definition; 2, function_name:argsort_indices; 3, parameters; 4, block; 5, identifier:a; 6, default_parameter; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, expression_statement; 11, return_statement; 12, identifier:axis; 13, unary_operator; 14, comment:"""Like argsort, but returns an index suitable for sorting the
      the original array even if that array is multidimensional
      """; 15, assignment; 16, assignment; 17, assignment; 18, call; 19, integer:1; 20, identifier:a; 21, call; 22, identifier:ind; 23, call; 24, subscript; 25, call; 26, identifier:tuple; 27, argument_list; 28, attribute; 29, argument_list; 30, identifier:list; 31, argument_list; 32, identifier:ind; 33, identifier:axis; 34, attribute; 35, argument_list; 36, identifier:ind; 37, identifier:np; 38, identifier:asarray; 39, identifier:a; 40, call; 41, identifier:a; 42, identifier:argsort; 43, identifier:axis; 44, attribute; 45, argument_list; 46, identifier:np; 47, identifier:ix_; 48, list_splat; 49, list_comprehension; 50, call; 51, for_in_clause; 52, attribute; 53, argument_list; 54, identifier:d; 55, attribute; 56, identifier:np; 57, identifier:arange; 58, identifier:d; 59, identifier:a; 60, identifier:shape
code: def argsort_indices(a, axis=-1):
      """Like argsort, but returns an index suitable for sorting the
      the original array even if that array is multidimensional
      """
      a = np.asarray(a)
      ind = list(np.ix_(*[np.arange(d) for d in a.shape]))
      ind[axis] = a.argsort(axis)
      return tuple(ind)