nodes: 0, module; 1, function_definition; 2, function_name:_ordered; 3, parameters; 4, block; 5, identifier:generator; 6, list_splat_pattern; 7, dictionary_splat_pattern; 8, expression_statement; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, for_statement; 13, return_statement; 14, identifier:args; 15, identifier:kwargs; 16, comment:"""Sort keys of unordered_dict and store in OrderedDict."""; 17, assignment; 18, assignment; 19, assignment; 20, identifier:key; 21, identifier:keys; 22, block; 23, identifier:result; 24, identifier:unordered_dict; 25, dictionary_comprehension; 26, identifier:keys; 27, call; 28, identifier:result; 29, call; 30, expression_statement; 31, pair; 32, for_in_clause; 33, identifier:sorted; 34, argument_list; 35, identifier:OrderedDict; 36, argument_list; 37, assignment; 38, identifier:k; 39, identifier:v; 40, pattern_list; 41, call; 42, call; 43, subscript; 44, subscript; 45, identifier:k; 46, identifier:v; 47, identifier:generator; 48, argument_list; 49, identifier:list; 50, argument_list; 51, identifier:result; 52, identifier:key; 53, identifier:unordered_dict; 54, identifier:key; 55, list_splat; 56, dictionary_splat; 57, call; 58, identifier:args; 59, identifier:kwargs; 60, attribute; 61, argument_list; 62, call; 63, identifier:keys; 64, identifier:dict; 65, argument_list; 66, identifier:unordered_dict
code: def _ordered(generator, *args, **kwargs):
      """Sort keys of unordered_dict and store in OrderedDict."""
      unordered_dict = {k: v for k, v in generator(*args, **kwargs)}
      keys = sorted(list(dict(unordered_dict).keys()))
      result = OrderedDict()
      for key in keys:
          result[key] = unordered_dict[key]
  
      return result