def decode_if_bytes(obj, mode=True):
if mode is True:<EOL><INDENT>mode = unicode_errors_default<EOL><DEDENT>if isinstance(obj, bytes):<EOL><INDENT>return obj.decode("<STR_LIT:utf-8>", errors=mode)<EOL><DEDENT>return obj<EOL>
Decode obj if it is bytes.