def mute_string(text):
 start = 1
 end = (len(text) - 1)
 if text.endswith('"'):
  start += text.index('"')
 elif text.endswith("'"):
  start += text.index("'")
 if (text.endswith('"""') or text.endswith("'''")):
  start += 2
  end -= 2
 return ((text[:start] + ('x' * (end - start))) + text[end:])

def mute_string ( text ) : start = 1 end = ( len ( text ) - 1 ) if text . endswith ( '"' ) : start += text . index ( '"' ) elif text . endswith ( "'" ) : start += text . index ( "'" ) if ( text . endswith ( '"""' ) or text . endswith ( "'''" ) ) : start += 2 end -= 2 return ( ( text [ : start ] + ( 'x' * ( end - start ) ) ) + text [ end : ] )
replace contents with xxx to prevent syntax matching .