def underscores_to_camelcase(argument):
 result = u''
 previous_was_underscore = False
 for char in argument:
  if (char != u'_'):
   if previous_was_underscore:
    result += char.upper()
   else:
    result += char
  previous_was_underscore = (char == u'_')
 return result

def underscores_to_camelcase ( argument ) : result = u'' previous_was_underscore = False for char in argument : if ( char != u'_' ) : if previous_was_underscore : result += char . upper ( ) else : result += char previous_was_underscore = ( char == u'_' ) return result
converts a camelcase param like the_new_attribute to the equivalent camelcase version like thenewattribute .