nodes: 0, module; 1, function_definition; 2, function_name:pretty; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, expression_statement; 8, for_statement; 9, return_statement; 10, string:"sort values and format output for viewing and comparing in test scenarios"; 11, assignment; 12, pattern_list; 13, call; 14, block; 15, identifier:pretty_obj; 16, identifier:pretty_obj; 17, call; 18, identifier:key; 19, identifier:value; 20, identifier:sorted; 21, argument_list; 22, if_statement; 23, identifier:OrderedDict; 24, argument_list; 25, call; 26, comparison_operator:value is None; 27, block; 28, elif_clause; 29, elif_clause; 30, elif_clause; 31, else_clause; 32, identifier:iteritems; 33, argument_list; 34, identifier:value; 35, None; 36, expression_statement; 37, call; 38, block; 39, call; 40, block; 41, call; 42, block; 43, block; 44, attribute; 45, assignment; 46, identifier:is_str_or_unicode; 47, argument_list; 48, expression_statement; 49, identifier:isinstance; 50, argument_list; 51, expression_statement; 52, identifier:isinstance; 53, argument_list; 54, expression_statement; 55, expression_statement; 56, identifier:self; 57, identifier:__dict__; 58, subscript; 59, None; 60, identifier:value; 61, assignment; 62, identifier:value; 63, identifier:list; 64, assignment; 65, identifier:value; 66, identifier:dict; 67, assignment; 68, assignment; 69, identifier:pretty_obj; 70, identifier:key; 71, subscript; 72, call; 73, subscript; 74, list; 75, subscript; 76, dictionary; 77, subscript; 78, call; 79, identifier:pretty_obj; 80, identifier:key; 81, attribute; 82, argument_list; 83, identifier:pretty_obj; 84, identifier:key; 85, identifier:pretty_obj; 86, identifier:key; 87, identifier:pretty_obj; 88, identifier:key; 89, identifier:unicode_value; 90, argument_list; 91, attribute; 92, identifier:get; 93, identifier:key; 94, identifier:value; 95, identifier:self; 96, identifier:__dict__
code: def pretty(self):
          "sort values and format output for viewing and comparing in test scenarios"
          pretty_obj = OrderedDict()
          for key, value in sorted(iteritems(self.__dict__)):
              if value is None:
                  pretty_obj[key] = None
              elif is_str_or_unicode(value):
                  pretty_obj[key] = self.__dict__.get(key)
              elif isinstance(value, list):
                  pretty_obj[key] = []
              elif isinstance(value, dict):
                  pretty_obj[key] = {}
              else:
                  pretty_obj[key] = unicode_value(value)
          return pretty_obj