<s> """<STR_LIT>""" <EOL> from collections import OrderedDict <EOL> import json <EOL> def encode ( data ) : <EOL> assert isinstance ( data , dict ) <EOL> def isnt_special ( entry ) : <EOL> return entry [ <NUM_LIT:0> ] not in ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT:error>' ) <EOL> ordered = OrderedDict ( sorted ( data . iteritems ( ) , key = isnt_special ) ) <EOL> return json . dumps ( ordered , separators = ( '<STR_LIT:U+002C>' , '<STR_LIT::>' ) ) + '<STR_LIT:\n>' <EOL> def decode ( data ) : <EOL> data = json . loads ( data ) <EOL> assert isinstance ( data , dict ) <EOL> return data </s>
