def apply_transition_sequence(parser, doc, sequence):
 for action_name in sequence:
  if (u'-' in action_name):
   (move, label) = action_name.split(u'-')
   parser.add_label(label)
 with parser.step_through(doc) as stepwise:
  for transition in sequence:
   stepwise.transition(transition)

def apply_transition_sequence ( parser , doc , sequence ) : for action_name in sequence : if ( u'-' in action_name ) : ( move , label ) = action_name . split ( u'-' ) parser . add_label ( label ) with parser . step_through ( doc ) as stepwise : for transition in sequence : stepwise . transition ( transition )
perform a series of pre-specified transitions .