code: def test_too_many_unaries_close():
      """
      This tests rejecting Close at the start of a sequence after too many unary transitions
  
      The model should reject doing multiple "unaries" - eg, Open then Close - in an IN_ORDER sequence
      """
      model = SimpleModel(TransitionScheme.IN_ORDER)
      state = build_initial_state(model)[0]
  
      shift = parse_transitions.Shift()
      assert shift.is_legal(state, model)
      state = shift.apply(state, model)
  
      open_np = parse_transitions.OpenConstituent("NP")
      close_trans = parse_transitions.CloseConstituent()
      for _ in range(UNARY_LIMIT):
          assert open_np.is_legal(state, model)
          state = open_np.apply(state, model)
  
          assert close_trans.is_legal(state, model)
          state = close_trans.apply(state, model)
  
      assert open_np.is_legal(state, model)
      state = open_np.apply(state, model)
      assert not close_trans.is_legal(state, model)
  
imports: import pytest
  from stanza.models.constituency import parse_transitions
  from stanza.models.constituency.base_model import SimpleModel, UNARY_LIMIT
  from stanza.models.constituency.parse_transitions import TransitionScheme, Shift, CloseConstituent, OpenConstituent
  from stanza.tests import *
label_desc: Use image node_id 10 for calling a global function with example usage: test_too_many_unaries_close() without return types