nodes: 0, module; 1, function_definition; 2, function_name:sort_key; 3, parameters; 4, block; 5, identifier:val; 6, expression_statement; 7, return_statement; 8, comment:"""Sort key for sorting keys in grevlex order."""; 9, call; 10, attribute; 11, argument_list; 12, identifier:numpy; 13, identifier:sum; 14, binary_operator:(max(val)+1)**numpy.arange(len(val)-1, -1, -1)*val; 15, binary_operator:(max(val)+1)**numpy.arange(len(val)-1, -1, -1); 16, identifier:val; 17, parenthesized_expression; 18, call; 19, binary_operator:max(val)+1; 20, attribute; 21, argument_list; 22, call; 23, integer:1; 24, identifier:numpy; 25, identifier:arange; 26, binary_operator:len(val)-1; 27, unary_operator; 28, unary_operator; 29, identifier:max; 30, argument_list; 31, call; 32, integer:1; 33, integer:1; 34, integer:1; 35, identifier:val; 36, identifier:len; 37, argument_list; 38, identifier:val
code: def sort_key(val):
      """Sort key for sorting keys in grevlex order."""
      return numpy.sum((max(val)+1)**numpy.arange(len(val)-1, -1, -1)*val)