<s> """<STR_LIT>""" <EOL> from zmqpy . utils . strtypes import bytes , unicode <EOL> jsonmod = None <EOL> try : <EOL> import jsonlib2 as jsonmod <EOL> except ImportError : <EOL> try : <EOL> import jsonlib as jsonmod <EOL> except ImportError : <EOL> try : <EOL> import simplejson as jsonmod <EOL> except ImportError : <EOL> try : <EOL> import json as jsonmod <EOL> except ImportError : <EOL> pass <EOL> def _squash_unicode ( s ) : <EOL> if isinstance ( s , unicode ) : <EOL> return s . encode ( '<STR_LIT:utf8>' ) <EOL> else : <EOL> return s <EOL> def jsonlib_dumps ( o , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> return _squash_unicode ( jsonmod . dumps ( o , ** kwargs ) ) <EOL> def dumps ( o , ** kwargs ) : <EOL> """<STR_LIT>""" % jsonmod <EOL> return _squash_unicode ( jsonmod . dumps ( o , separators = ( '<STR_LIT:U+002C>' , '<STR_LIT::>' ) , ** kwargs ) ) <EOL> def loads ( s , ** kwargs ) : <EOL> """<STR_LIT>""" % jsonmod <EOL> if str is unicode and isinstance ( s , bytes ) : <EOL> s = s . decode ( '<STR_LIT:utf8>' ) <EOL> return jsonmod . loads ( s , ** kwargs ) <EOL> if jsonmod is not None and jsonmod . __name__ == '<STR_LIT>' : <EOL> dumps = jsonlib_dumps <EOL> __all__ = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] </s>
