nodes: 0, module; 1, function_definition; 2, function_name:sort_single_reference; 3, parameters; 4, block; 5, identifier:ref_entry; 6, expression_statement; 7, comment:# yapf: disable; 8, expression_statement; 9, comment:# yapf: enable; 10, expression_statement; 11, if_statement; 12, comment:"""Sorts a dictionary containing data for a single reference into a standard order
      """; 13, assignment; 14, assignment; 15, identifier:_use_odict; 16, block; 17, else_clause; 18, identifier:_keyorder; 19, list; 20, identifier:sorted_entry; 21, call; 22, return_statement; 23, block; 24, comment:# Schema stuff; 25, comment:# This function gets called on the schema 'entry', too; 26, string; 27, string; 28, comment:# Type of the entry; 29, string; 30, comment:# Actual publication info; 31, string; 32, string; 33, string; 34, string; 35, string; 36, string; 37, string; 38, string; 39, string; 40, string; 41, string; 42, string; 43, string; 44, string; 45, string; 46, string; 47, identifier:sorted; 48, argument_list; 49, call; 50, return_statement; 51, string_content:schema_type; 52, string_content:schema_version; 53, string_content:type; 54, string_content:authors; 55, string_content:title; 56, string_content:booktitle; 57, string_content:series; 58, string_content:editors; 59, string_content:journal; 60, string_content:institution; 61, string_content:volume; 62, string_content:number; 63, string_content:page; 64, string_content:year; 65, string_content:note; 66, string_content:publisher; 67, string_content:address; 68, string_content:isbn; 69, string_content:doi; 70, call; 71, keyword_argument; 72, identifier:OrderedDict; 73, argument_list; 74, call; 75, attribute; 76, argument_list; 77, identifier:key; 78, lambda; 79, identifier:sorted_entry; 80, identifier:dict; 81, argument_list; 82, identifier:ref_entry; 83, identifier:items; 84, lambda_parameters; 85, call; 86, identifier:sorted_entry; 87, identifier:x; 88, attribute; 89, argument_list; 90, identifier:_keyorder; 91, identifier:index; 92, subscript; 93, identifier:x; 94, integer:0
code: def sort_single_reference(ref_entry):
      """Sorts a dictionary containing data for a single reference into a standard order
      """
  
      # yapf: disable
      _keyorder = [
          # Schema stuff
          # This function gets called on the schema 'entry', too
          'schema_type', 'schema_version',
  
          # Type of the entry
          'type',
  
          # Actual publication info
          'authors', 'title', 'booktitle', 'series', 'editors', 'journal',
          'institution', 'volume', 'number', 'page', 'year', 'note', 'publisher',
          'address', 'isbn', 'doi'
      ]
      # yapf: enable
  
      sorted_entry = sorted(ref_entry.items(), key=lambda x: _keyorder.index(x[0]))
  
      if _use_odict:
          return OrderedDict(sorted_entry)
      else:
          return dict(sorted_entry)