def apply_transition_sequence(parser, doc, sequence):
for action_name in sequence:<EOL><INDENT>if "<STR_LIT:->" in action_name:<EOL><INDENT>move, label = action_name.split("<STR_LIT:->")<EOL>parser.add_label(label)<EOL><DEDENT><DEDENT>with parser.step_through(doc) as stepwise:<EOL><INDENT>for transition in sequence:<EOL><INDENT>stepwise.transition(transition)<EOL><DEDENT><DEDENT>
Perform a series of pre-specified transitions, to put the parser in a
    desired state.