def unescape_string_literal(s):
 if ((s[0] not in u'"\'') or (s[(-1)] != s[0])):
  raise ValueError((u'Not a string literal: %r' % s))
 quote = s[0]
 return s[1:(-1)].replace((u'\\%s' % quote), quote).replace(u'\\\\', u'\\')

def unescape_string_literal ( s ) : if ( ( s [ 0 ] not in u'"\'' ) or ( s [ ( - 1 ) ] != s [ 0 ] ) ) : raise ValueError ( ( u'Not a string literal: %r' % s ) ) quote = s [ 0 ] return s [ 1 : ( - 1 ) ] . replace ( ( u'\\%s' % quote ) , quote ) . replace ( u'\\\\' , u'\\' )
convert quoted string literals to unquoted strings with escaped quotes and backslashes unquoted:: .