nodes: 0, module; 1, function_definition; 2, function_name:sort_dict_by_key; 3, parameters; 4, block; 5, identifier:obj; 6, expression_statement; 7, expression_statement; 8, return_statement; 9, comment:"""
      Sort dict by its keys
  
      >>> sort_dict_by_key(dict(c=1, b=2, a=3, d=4))
      OrderedDict([('a', 3), ('b', 2), ('c', 1), ('d', 4)])
      """; 10, assignment; 11, call; 12, identifier:sort_func; 13, lambda; 14, identifier:OrderedDict; 15, argument_list; 16, lambda_parameters; 17, subscript; 18, call; 19, identifier:x; 20, identifier:x; 21, integer:0; 22, identifier:sorted; 23, argument_list; 24, call; 25, keyword_argument; 26, attribute; 27, argument_list; 28, identifier:key; 29, identifier:sort_func; 30, identifier:obj; 31, identifier:items
code: def sort_dict_by_key(obj):
      """
      Sort dict by its keys
  
      >>> sort_dict_by_key(dict(c=1, b=2, a=3, d=4))
      OrderedDict([('a', 3), ('b', 2), ('c', 1), ('d', 4)])
      """
      sort_func = lambda x: x[0]
      return OrderedDict(sorted(obj.items(), key=sort_func))