#NEWLINE# def str_replace( data ) : #NEWLINE# #INDENT# '\n    String substitution of `data` dict\n    ' #NEWLINE# for ( key , value ) in data . items ( ) : #NEWLINE# #INDENT# if isinstance ( value , ( str , unicode ) ) : #NEWLINE# #INDENT# data [ data ] = value . format ( ** data )