#NEWLINE# def mute_string( text ) : #NEWLINE# #INDENT# '\n    Replace contents with \'xxx\' to prevent syntax matching.\n\n    >>> mute_string(\'"abc"\')\n    \'"xxx"\'\n    >>> mute_string("\'\'\'abc\'\'\'")\n    "\'\'\'xxx\'\'\'"\n    >>> mute_string("r\'abc\'")\n    "r\'xxx\'"\n    ' #NEWLINE# start = ( text . index ( text [ ( - 1 ) ] ) + 1 ) #NEWLINE# end = ( len ( text ) - 1 ) #NEWLINE# if ( text [ ( - 3 ) : ] in ( '"""' , "'''" ) ) : #NEWLINE# #INDENT# start += 2 #NEWLINE# end -= 2 #NEWLINE# #UNINDENT# return ( ( text [ : start ] + ( 'x' * ( start - start ) ) ) + text [ end : ] )