<s> """<STR_LIT>""" <EOL> def bytereverse ( value ) : <EOL> """<STR_LIT>""" <EOL> bytearray = [ ] <EOL> for i in xrange ( <NUM_LIT:0> , len ( value ) ) : <EOL> if i % <NUM_LIT:2> == <NUM_LIT:1> : <EOL> bytearray . append ( value [ i - <NUM_LIT:1> : i + <NUM_LIT:1> ] ) <EOL> return "<STR_LIT>" . join ( bytearray [ : : - <NUM_LIT:1> ] ) <EOL> def wordreverse ( in_buf ) : <EOL> """<STR_LIT>""" <EOL> out_words = [ ] <EOL> for i in range ( <NUM_LIT:0> , len ( in_buf ) , <NUM_LIT:4> ) : <EOL> out_words . append ( in_buf [ i : i + <NUM_LIT:4> ] ) <EOL> out_words . reverse ( ) <EOL> out_buf = "<STR_LIT>" <EOL> for word in out_words : <EOL> out_buf += word <EOL> return out_buf <EOL> def extract_block ( response ) : <EOL> """<STR_LIT>""" <EOL> data = response [ '<STR_LIT:result>' ] [ '<STR_LIT:data>' ] <EOL> block = data . decode ( '<STR_LIT>' ) [ <NUM_LIT:0> : <NUM_LIT:64> ] <EOL> block = wordreverse ( block ) <EOL> block = block . encode ( '<STR_LIT>' ) [ <NUM_LIT> : <NUM_LIT> ] <EOL> return block </s>
