def css_escape(s):
 s = re.sub('(^-$|[ !"#\\$%&\\\'()*+,./:;<=>?@\\[\\\\\\]^`{|}~])', '\\\\\\1', s)
 s = re.sub('^(-?)(\\d)', (lambda m: ('%s\\%x ' % (m.group(1), ord(m.group(2))))), s)
 s = re.sub('([\\t\\n\\v\\f\\r])', (lambda m: ('\\%x ' % ord(m.group(1)))), s)
 return s

def css_escape ( s ) : s = re . sub ( '(^-$|[ !"#\\$%&\\\'()*+,./:;<=>?@\\[\\\\\\]^`{|}~])' , '\\\\\\1' , s ) s = re . sub ( '^(-?)(\\d)' , ( lambda m : ( '%s\\%x ' % ( m . group ( 1 ) , ord ( m . group ( 2 ) ) ) ) ) , s ) s = re . sub ( '([\\t\\n\\v\\f\\r])' , ( lambda m : ( '\\%x ' % ord ( m . group ( 1 ) ) ) ) , s ) return s
from URL .