code: def test_missed_unary(gold_sequences):
      """
      Test the repairs of an open/open error if it is effectively a skipped unary transition
      """
      wrong_transition = OpenConstituent("S")
  
      repairs = get_repairs(
          gold_sequences[0],
          wrong_transition,
          fix_wrong_open_unary_chain,
      )
      assert len(repairs) == 0
  
      # here we are simulating picking NT-S instead of NT-VP
      # the DOUBLE_UNARY tree has one location where this is relevant, index 11
      repairs = get_repairs(
          gold_sequences[1],
          wrong_transition,
          fix_wrong_open_unary_chain,
      )
      assert len(repairs) == 1
      assert repairs[0][0] == 11
      assert (
          repairs[0][1]
          == gold_sequences[1][:11] + gold_sequences[1][13:]
      )
  
      # the TRIPLE_UNARY_START tree has two locations where this is relevant
      # at index 1, the pattern goes (S (VP ...))
      # so choosing S instead of VP means you can skip the VP and only miss that one bracket
      # at index 5, the pattern goes (S (PRN (S (VP ...))) (...))
      # note that this is capturing a unary transition into a larger constituent
      # skipping the PRN is satisfactory
      repairs = get_repairs(
          gold_sequences[2],
          wrong_transition,
          fix_wrong_open_unary_chain,
      )
      assert len(repairs) == 2
      assert repairs[0][0] == 1
      assert (
          repairs[0][1] == gold_sequences[2][:1] + gold_sequences[2][3:]
      )
      assert repairs[1][0] == 5
      assert (
          repairs[1][1] == gold_sequences[2][:5] + gold_sequences[2][7:]
      )
  
      # The TRIPLE_UNARY_END tree has 2 sections of tree for a total of 3 locations
      # where the repair might happen
      # Surprisingly the unary transition at the very start can only be
      # repaired by skipping it and using the outer S transition instead
      # The second repair overall (first repair in the second location)
      # should have a double skip to reach the S node
      repairs = get_repairs(
          gold_sequences[3],
          wrong_transition,
          fix_wrong_open_unary_chain,
      )
      assert len(repairs) == 3
      assert repairs[0][0] == 1
      assert (
          repairs[0][1] == gold_sequences[3][:1] + gold_sequences[3][3:]
      )
      assert repairs[1][0] == 21
      assert (
          repairs[1][1]
          == gold_sequences[3][:21] + gold_sequences[3][25:]
      )
      assert repairs[2][0] == 23
      assert (
          repairs[2][1]
          == gold_sequences[3][:23] + gold_sequences[3][25:]
      )
  
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 5 for calling a global function with example usage: test_missed_unary(gold_sequences) without return types