def METHOD_NAME(protocol):
    f = Flow(protocol=protocol).add(uses=DummyCrafterNotImplemented)
    hit = []
    def f1(*args):
        hit.append('done')
    def f2(*args):
        hit.append('error')
    def f3(*args):
        hit.append('always')
    with f:
        f.index(
            from_ndarray(np.random.random([10, 10])),
            on_done=f1,
            on_error=f2,
            on_always=f3,
        )
    assert hit == ['error', 'always']