def escape_identifier(text, reg=KWD_RE):
 if (not text):
  return '_'
 if text[0].isdigit():
  text = ('_' + text)
 return reg.sub('\\1_', text)

def escape_identifier ( text , reg = KWD_RE ) : if ( not text ) : return '_' if text [ 0 ] . isdigit ( ) : text = ( '_' + text ) return reg . sub ( '\\1_' , text )
escape partial c identifiers so they can be used as attributes/arguments .