<s> """<STR_LIT>""" <EOL> import json as pyjson <EOL> from six import PY2 <EOL> class JSONEncoder ( pyjson . JSONEncoder ) : <EOL> """<STR_LIT>""" <EOL> def default ( self , o ) : <EOL> if isinstance ( o , bytes ) : <EOL> return o . decode ( "<STR_LIT:utf-8>" ) <EOL> return pyjson . JSONEncoder . default ( self , o ) <EOL> _encoder = JSONEncoder ( ) <EOL> def _loads ( s ) : <EOL> if isinstance ( s , bytes ) : <EOL> s = s . decode ( "<STR_LIT:utf-8>" ) <EOL> return pyjson . loads ( s ) <EOL> def _dumps ( obj ) : <EOL> return _encoder . encode ( obj ) . encode ( "<STR_LIT:utf-8>" ) <EOL> if PY2 : <EOL> loads , dumps = pyjson . loads , pyjson . dumps <EOL> else : <EOL> loads , dumps = _loads , _dumps <EOL> __all__ = [ "<STR_LIT>" , "<STR_LIT>" ] </s>
