<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def as_text(str_or_bytes, encoding='utf-8', errors='strict'):
 """Return input string as a text string. Should work for input string that's unicode or bytes, given proper encoding. foo True """

    if isinstance(str_or_bytes, text):
        return str_or_bytes
    return str_or_bytes.decode(encoding, errors)