def METHOD_NAME(self, txn: BankAccountTransaction):
    cnt_keys = (1 if txn.key1 is not None else 0) + (1 if txn.key2 is not None else 0)
    if cnt_keys == 0:
        self.error(txn.commit_time, txn.id, "Txn without keys: {}".format(txn))
    elif cnt_keys == 1:
        self.error(txn.commit_time, txn.id, "Not full txn: {}".format(txn))