def _assert_valid_locale(self, locale):
if locale is not None and not LOCALE_REGEX.match(locale):<EOL><INDENT>raise ValueError("<STR_LIT>" % locale)<EOL><DEDENT>
Asserts that the locale is valid, throws a ValueError if not.