<s> """<STR_LIT>""" <EOL> from copy import deepcopy <EOL> from stomper import Frame <EOL> reservedHeaders = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> def filterReservedHeaders ( headers ) : <EOL> filtered = headers . copy ( ) <EOL> for hdr in reservedHeaders : <EOL> if hdr in filtered : <EOL> del filtered [ hdr ] <EOL> return filtered <EOL> def cloneStompMessageForErrorDest ( msg ) : <EOL> errMsg = deepcopy ( msg ) <EOL> errMsg [ '<STR_LIT>' ] = filterReservedHeaders ( msg [ '<STR_LIT>' ] ) <EOL> errMsg [ '<STR_LIT>' ] [ '<STR_LIT>' ] = '<STR_LIT:true>' <EOL> return errMsg <EOL> def createFrame ( message ) : <EOL> frame = Frame ( ) <EOL> frame . cmd = message [ '<STR_LIT>' ] <EOL> frame . headers = message [ '<STR_LIT>' ] <EOL> frame . body = message [ '<STR_LIT:body>' ] <EOL> return frame </s>
