def handle_data_api(context, data):
    if context.incr == 0:
        assert context.portfolio.positions not in 0
    else:
        assert context.portfolio.positions[0]['amount'] == \
            context.incr, "Orders not filled immediately."
        assert context.portfolio.positions[0]['last_sale_price'] == \
            data.current(sid(0), "price"), \
            "Orders not filled at current price."
    context.incr += 1
    order(sid(0), 1)

    record(incr=context.incr)

###########################
# AlgoScripts as strings
dataset/ETHPy150Open quantopian/zipline/zipline/test_algorithms.py/handle_data_api/swapped operands of `not in`