def _tup_and_byte(obj):
<EOL>if isinstance(obj, unicode):<EOL><INDENT>return obj.encode('<STR_LIT:utf-8>')<EOL><DEDENT>if isinstance(obj, list):<EOL><INDENT>return [_tup_and_byte(item) for item in obj]<EOL><DEDENT>if isinstance(obj, dict):<EOL><INDENT>if "<STR_LIT>" in obj:<EOL><INDENT>return tuple(_tup_and_byte(item) for item in obj["<STR_LIT>"])<EOL><DEDENT>else:<EOL><INDENT>return {<EOL>_tup_and_byte(key): _tup_and_byte(val) forkey, val in obj.iteritems()<EOL>}<EOL><DEDENT><DEDENT>return obj<EOL>
wat