code: def format_language(language):
      
      if not language:
          return language
  
      if not re.match('^[a-zA-Z]{2}[_-][a-zA-Z]{2}$', language):
          raise TwiMLException('Invalid value for language parameter.')
  
      return language[0:2].lower() + '-' + language[3:5].upper()
docs: Attempt to format language parameter as 'ww-WW'.
  
      :param string language: language parameter