def METHOD_NAME(transaction: dict) -> messages.NEMImportanceTransfer:
    return messages.NEMImportanceTransfer(
        mode=transaction["importanceTransfer"]["mode"],
        public_key=bytes.fromhex(transaction["importanceTransfer"]["publicKey"]),
    )