nodes: 0, module; 1, function_definition; 2, function_name:sort_references_dict; 3, parameters; 4, block; 5, identifier:refs; 6, expression_statement; 7, if_statement; 8, comment:# We insert this first, That is ok - it will be overwritten; 9, comment:# with the sorted version later; 10, expression_statement; 11, comment:# This sorts the entries by reference key (author1985a, etc); 12, for_statement; 13, return_statement; 14, comment:"""Sorts a reference dictionary into a standard order
  
      The keys of the references are also sorted, and the keys for the data for each
      reference are put in a more canonical order.
      """; 15, identifier:_use_odict; 16, block; 17, else_clause; 18, assignment; 19, pattern_list; 20, call; 21, block; 22, identifier:refs_sorted; 23, expression_statement; 24, block; 25, subscript; 26, subscript; 27, identifier:k; 28, identifier:v; 29, identifier:sorted; 30, argument_list; 31, expression_statement; 32, assignment; 33, expression_statement; 34, identifier:refs_sorted; 35, string; 36, identifier:refs; 37, string; 38, call; 39, assignment; 40, identifier:refs_sorted; 41, call; 42, assignment; 43, string_content:molssi_bse_schema; 44, string_content:molssi_bse_schema; 45, attribute; 46, argument_list; 47, subscript; 48, call; 49, identifier:OrderedDict; 50, argument_list; 51, identifier:refs_sorted; 52, call; 53, identifier:refs; 54, identifier:items; 55, identifier:refs_sorted; 56, identifier:k; 57, identifier:sort_single_reference; 58, argument_list; 59, identifier:dict; 60, argument_list; 61, identifier:v
code: def sort_references_dict(refs):
      """Sorts a reference dictionary into a standard order
  
      The keys of the references are also sorted, and the keys for the data for each
      reference are put in a more canonical order.
      """
  
      if _use_odict:
          refs_sorted = OrderedDict()
      else:
          refs_sorted = dict()
  
      # We insert this first, That is ok - it will be overwritten
      # with the sorted version later
      refs_sorted['molssi_bse_schema'] = refs['molssi_bse_schema']
  
      # This sorts the entries by reference key (author1985a, etc)
      for k, v in sorted(refs.items()):
          refs_sorted[k] = sort_single_reference(v)
  
      return refs_sorted