def run_full_test():

    keys = []

    def save_key(private_key):
        keys.append(private_key)
        return private_key

    def check_balances_and_transactions(unused, bal1, bal2, num_transactions):

        def assert_balance_is(actual, expected):
            assert abs(expected - actual) < .05
            print "correct balance. actual:", str(actual), "expected:", str(expected)
            return True

        def assert_transaction_length_is(transactions, expected_length):
            assert len(transactions) == expected_length
            print "correct transaction length"
            return True

        d1 = get_balance(keys[0])
        d1.addCallback(assert_balance_is, bal1)

        d2 = get_balance(keys[1])
        d2.addCallback(assert_balance_is, bal2)

        d3 = get_recent_transactions(keys[0])
        d3.addCallback(assert_transaction_length_is, num_transactions)

        d4 = get_recent_transactions(keys[1])
        d4.addCallback(assert_transaction_length_is, num_transactions)

        dl = defer.DeferredList([d1, d2, d3, d4])
        return dl

    def do_transfer(unused, amount):
        d = send_points(keys[0], keys[1].publickey().exportKey(), amount)
        return d

    d1 = threads.deferToThread(RSA.generate, 4096)
    d1.addCallback(save_key)
    d1.addCallback(register_new_account)
    d2 = threads.deferToThread(RSA.generate, 4096)
    d2.addCallback(save_key)
    d2.addCallback(register_new_account)
    dlist = defer.DeferredList([d1, d2])
    dlist.addCallback(check_balances_and_transactions, 1000, 1000, 0)
    dlist.addCallback(do_transfer, 50)
    dlist.addCallback(check_balances_and_transactions, 950, 1050, 1)
    dlist.addCallback(do_transfer, 75)
    dlist.addCallback(check_balances_and_transactions, 875, 1125, 2)
    dlist.addErrback(print_error)
dataset/ETHPy150Open lbryio/lbry/lbrynet/pointtraderclient/pointtraderclient.py/run_full_test/swapped operands of `-`