<s> import time <EOL> import uuid <EOL> import copy <EOL> try : <EOL> import ujson as json <EOL> except ImportError : <EOL> try : <EOL> import simplejson as json <EOL> except ImportError : <EOL> import json <EOL> def unpack ( message ) : <EOL> return json . loads ( message ) <EOL> def pack ( msg ) : <EOL> return json . dumps ( msg ) <EOL> def envelp ( message , msg_id ) : <EOL> return { <EOL> '<STR_LIT>' : [ ] , <EOL> '<STR_LIT>' : time . time ( ) , <EOL> '<STR_LIT>' : msg_id , <EOL> '<STR_LIT>' : message , <EOL> } <EOL> def msg_body ( msg ) : <EOL> print "<STR_LIT>" <EOL> return get_msg_body ( msg ) <EOL> def get_msg_body ( msg ) : <EOL> try : <EOL> return msg [ '<STR_LIT>' ] . values ( ) [ <NUM_LIT:0> ] <EOL> except : <EOL> return msg </s>
