nodes: 0, module; 1, function_definition; 2, function_name:sorted_options; 3, parameters; 4, block; 5, identifier:sort_options; 6, expression_statement; 7, return_statement; 8, comment:"""Sort sort options for display.
  
      :param sort_options: A dictionary containing the field name as key and
          asc/desc as value.
      :returns: A dictionary with sorting options for Invenio-Search-JS.
      """; 9, list_comprehension; 10, dictionary; 11, for_in_clause; 12, pair; 13, pair; 14, pattern_list; 15, call; 16, string; 17, subscript; 18, string; 19, parenthesized_expression; 20, identifier:k; 21, identifier:v; 22, identifier:sorted; 23, argument_list; 24, string_content:title; 25, identifier:v; 26, string; 27, string_content:value; 28, conditional_expression:'-{0}'.format(k)
                        if v.get('default_order', 'asc') == 'desc' else k; 29, call; 30, keyword_argument; 31, string_content:title; 32, call; 33, comparison_operator:v.get('default_order', 'asc') == 'desc'; 34, identifier:k; 35, attribute; 36, argument_list; 37, identifier:key; 38, lambda; 39, attribute; 40, argument_list; 41, call; 42, string; 43, identifier:sort_options; 44, identifier:items; 45, lambda_parameters; 46, call; 47, string; 48, identifier:format; 49, identifier:k; 50, attribute; 51, argument_list; 52, string_content:desc; 53, identifier:x; 54, attribute; 55, argument_list; 56, string_content:-{0}; 57, identifier:v; 58, identifier:get; 59, string; 60, string; 61, subscript; 62, identifier:get; 63, string; 64, integer:0; 65, string_content:default_order; 66, string_content:asc; 67, identifier:x; 68, integer:1; 69, string_content:order
code: def sorted_options(sort_options):
      """Sort sort options for display.
  
      :param sort_options: A dictionary containing the field name as key and
          asc/desc as value.
      :returns: A dictionary with sorting options for Invenio-Search-JS.
      """
      return [
          {
              'title': v['title'],
              'value': ('-{0}'.format(k)
                        if v.get('default_order', 'asc') == 'desc' else k),
          }
          for k, v in
          sorted(sort_options.items(), key=lambda x: x[1].get('order', 0))
      ]