def decode_mysql_literal(text):
if MYSQL_NULL_PATTERN.match(text):<EOL><INDENT>return None<EOL><DEDENT>if MYSQL_BOOLEAN_PATTERN.match(text):<EOL><INDENT>return text.lower() == "<STR_LIT:true>"<EOL><DEDENT>if MYSQL_FLOAT_PATTERN.match(text):<EOL><INDENT>return float(text)<EOL><DEDENT>if MYSQL_INT_PATTERN.match(text):<EOL><INDENT>return int(text)<EOL><DEDENT>if MYSQL_STRING_PATTERN.match(text):<EOL><INDENT>return decode_mysql_string_literal(text)<EOL><DEDENT>raise ValueError("<STR_LIT>" % (text,))<EOL>
Attempts to decode given MySQL literal into Python value.

:param text: Value to be decoded, as MySQL literal.
:type text: str

:return: Python version of the given MySQL literal.
:rtype: any