#NEWLINE# def evaluate_object( obj , params ) : #NEWLINE# #INDENT# 'Returns a copy of `obj` after parsing strings in it using `params`.' #NEWLINE# if isinstance ( obj , basestring ) : #NEWLINE# #INDENT# return parse_string ( obj , item ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( obj , list ) : #NEWLINE# #INDENT# new_list = [ ] #NEWLINE# for item in obj : #NEWLINE# #INDENT# new_list . append ( evaluate_object ( item , params ) ) #NEWLINE# #UNINDENT# return new_list #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( obj , dict ) : #NEWLINE# #INDENT# new_dict = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for key in obj : #NEWLINE# #INDENT# new_dict [ key ] = evaluate_object ( obj [ key ] , params ) #NEWLINE# #UNINDENT# return new_dict #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return copy . deepcopy ( obj )