code: def decode_sent_msg(pref, message, pretty=False):
      
      newline = "\n" if pretty else " "
      indent = "    " if pretty else ""
      start = newline + indent
  
      out = []
      out.append("%s%s{%sSEQNUM: %d," % (pref, newline, start, message[Const.W_SEQ]))
      out.append("%sCOMPRESSION: %d," % (start, message[Const.W_COMPRESSION]))
      out.append("%sHASH: %s...," % (start, str(binascii.b2a_hex(message[Const.W_HASH]).decode('ascii'))[:10]))
      out.append("%sMESSAGE:%s{%sCLIENTREF: %s," % (start, start, start + indent,
                                                    message[Const.W_MESSAGE][Const.M_CLIENTREF]))
      out.append("%sRESOURCE: %s," % (start + indent, R_TYPES[message[Const.W_MESSAGE][Const.M_RESOURCE]]))
      out.append("%sTYPE: %s," % (start + indent, C_TYPES[message[Const.W_MESSAGE][Const.M_TYPE]]))
      out.append("%sACTION: %s," % (start + indent, message[Const.W_MESSAGE][Const.M_ACTION]))
      if Const.M_RANGE in message[Const.W_MESSAGE]:
          out.append("%sRANGE: %s," % (start + indent, message[Const.W_MESSAGE][Const.M_RANGE]))
      out.append("%sPAYLOAD: %s%s}%s}" % (start + indent, message[Const.W_MESSAGE][Const.M_PAYLOAD], start, newline))
  
      return ''.join(out)
docs: decode_sent_msg: Return a string of the decoded message