def decamel(s, separator='_'):
 s = re.sub('([a-z0-9])([A-Z])', ('\\1%s\\2' % separator), s)
 s = re.sub('([A-Z])([A-Z][a-z])', ('\\1%s\\2' % separator), s)
 s = s.lower()
 return s

def decamel ( s , separator = '_' ) : s = re . sub ( '([a-z0-9])([A-Z])' , ( '\\1%s\\2' % separator ) , s ) s = re . sub ( '([A-Z])([A-Z][a-z])' , ( '\\1%s\\2' % separator ) , s ) s = s . lower ( ) return s
returns the string with camelcase converted to underscores .