code: def sorted_options(sort_options):
      
      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))
      ]
docs: 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.