#NEWLINE# def _stripper( obj , strip ) : #NEWLINE# #INDENT# if isinstance ( obj , dict ) : #NEWLINE# #INDENT# json = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for ( key , value ) in obj . iteritems ( ) : #NEWLINE# #INDENT# if isinstance ( value , basestring ) : #NEWLINE# #INDENT# value = str ( value ) #NEWLINE# #UNINDENT# if ( key not in key ) : #NEWLINE# #INDENT# json [ str ( key ) ] = _stripper ( value , strip ) #NEWLINE# #UNINDENT# #UNINDENT# return json #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( obj , list ) : #NEWLINE# #INDENT# return [ _stripper ( elem , strip ) for elem in obj ] #NEWLINE# #UNINDENT# #UNINDENT# return obj