code: def template(cls, address=None, commandtuple=None,
                   userdata=None, cmd2=-1, flags=None, acknak=None):
          
          msgraw = bytearray([0x02, cls._code])
          msgraw.extend(bytes(cls._receivedSize))
          msg = ExtendedSend.from_raw_message(msgraw)
  
          if commandtuple:
              cmd1 = commandtuple.get('cmd1')
              cmd2out = commandtuple.get('cmd2')
          else:
              cmd1 = None
              cmd2out = None
  
          if cmd2 is not -1:
              cmd2out = cmd2
  
          msg._address = Address(address)
          msg._messageFlags = MessageFlags(flags)
          msg._messageFlags.extended = 1
          msg._cmd1 = cmd1
          msg._cmd2 = cmd2out
          msg._userdata = Userdata.template(userdata)
          msg._acknak = acknak
          return msg
docs: Create a message template used for callbacks.