def detect(context):
    nonlocal alternatives_executed
    with context.require_any():
        with context.alternative():
            alternatives_executed.add(1)
            context.fail('bad alternative 1')
        with context.alternative():
            alternatives_executed.add(2)
        with context.alternative():
            alternatives_executed.add(3)
            context.fail('bad alternative 3')
def detect(context):
    nonlocal alternatives_executed
    with context.require_any():
        with context.alternative():
            alternatives_executed.add(1)
            context.fail('bad alternative 1')
        with context.alternative():
            alternatives_executed.add(2)
        with context.alternative():
            alternatives_executed.add(3)
            context.fail('bad alternative 3')