code: def test_missed_unary(unary_trees, gold_sequences):
      shift_transition = Shift()
      close_transition = CloseConstituent()
  
      expected_close_results = [
          [(12, 2)],
          [(11, 4), (13, 2)],
          # (NP NN thumb) and (NP NN ballooning) are both candidates for this repair
          [(18, 2), (24, 2)],
          [(21, 6), (23, 4), (25, 2)],
      ]
  
      expected_shift_results = [
          (),
          (),
          (),
          # (ADVP-CLR (RB along)) is followed by a shift
          [(16, 2)],
      ]
  
      for tree, sequence, expected_close, expected_shift in zip(
          unary_trees,
          gold_sequences,
          expected_close_results,
          expected_shift_results,
      ):
          repairs = get_repairs(
              sequence, close_transition, fix_missed_unary
          )
          assert len(repairs) == len(expected_close)
          for repair, (expected_idx, expected_len) in zip(
              repairs, expected_close
          ):
              assert repair[0] == expected_idx
              assert (
                  repair[1]
                  == sequence[:expected_idx]
                  + sequence[expected_idx + expected_len :]
              )
  
          repairs = get_repairs(
              sequence, shift_transition, fix_missed_unary
          )
          assert len(repairs) == len(expected_shift)
          for repair, (expected_idx, expected_len) in zip(
              repairs, expected_shift
          ):
              assert repair[0] == expected_idx
              assert (
                  repair[1]
                  == sequence[:expected_idx]
                  + sequence[expected_idx + expected_len :]
              )
  
imports: import itertools
  import pytest
  from stanza.models.constituency import parse_transitions
  from stanza.models.constituency import tree_reader
  from stanza.models.constituency.base_model import SimpleModel
  from stanza.models.constituency.in_order_oracle import *
  from stanza.models.constituency.parse_transitions import CloseConstituent, OpenConstituent, Shift, TransitionScheme
  from stanza.models.constituency.transition_sequence import build_treebank
  from stanza.tests import *
  from stanza.tests.constituency.test_transition_sequence import reconstruct_tree
label_desc: Use image node_id 8 for calling a global function with example usage: test_missed_unary(unary_trees, gold_sequences) without return types