def format_language(language):
if not language:<EOL><INDENT>return language<EOL><DEDENT>if not re.match('<STR_LIT>', language):<EOL><INDENT>raise TwiMLException('<STR_LIT>')<EOL><DEDENT>return language[<NUM_LIT:0>:<NUM_LIT:2>].lower() + '<STR_LIT:->' + language[<NUM_LIT:3>:<NUM_LIT:5>].upper()<EOL>
Attempt to format language parameter as 'ww-WW'.

:param string language: language parameter