def _unicode_to_ascii(obj):  
<EOL>if isinstance(obj, dict):<EOL><INDENT>return dict(<EOL>[<EOL>(_unicode_to_ascii(key), _unicode_to_ascii(value))<EOL>for key, value in obj.items()<EOL>]<EOL>)<EOL><DEDENT>if isinstance(obj, list):<EOL><INDENT>return [_unicode_to_ascii(element) for element in obj]<EOL><DEDENT>if isinstance(obj, unicode):<EOL><INDENT>return obj.encode("<STR_LIT:utf-8>")<EOL><DEDENT>return obj<EOL>
Convert to ASCII.