#NEWLINE# def camelcase( snakecase_string , capitalize_head = False ) : #NEWLINE# #INDENT# '\n    :type snakecase_string: str\n    :rtype: str\n    ' #NEWLINE# result = _underscore_prefix_letter_pattern . sub ( ( lambda x : x . group ( 1 ) . upper ( ) ) , snakecase_string ) #NEWLINE# if capitalize_head : #NEWLINE# #INDENT# result = ( result [ 0 ] . upper ( ) + result [ 1 : ] ) #NEWLINE# #UNINDENT# return result