def Text(value, encoding=None):
if encoding is None:<EOL><INDENT>encoding = '<STR_LIT:utf-8>'<EOL><DEDENT>if isinstance(value, bytes):<EOL><INDENT>return value.decode(encoding)<EOL><DEDENT>elif isinstance(value, unicode):<EOL><INDENT>return value<EOL><DEDENT>return None<EOL>
Parse a value as text.

:type  value: `unicode` or `bytes`
:param value: Text value to parse

:type  encoding: `bytes`
:param encoding: Encoding to treat ``bytes`` values as, defaults to
    ``utf-8``.

:rtype: `unicode`
:return: Parsed text or ``None`` if ``value`` is neither `bytes` nor
    `unicode`.