code: def test_chinese_tree_reversed():
      """
      test that the reversed transitions also work
      """
      trees = tree_reader.read_trees(CHINESE_LONG_LIST_TREE)
  
      transitions = transition_sequence.build_treebank(
          trees,
          transition_scheme=TransitionScheme.TOP_DOWN,
          reverse=True,
      )
      redone = reconstruct_tree(
          trees[0],
          transitions[0],
          transition_scheme=TransitionScheme.TOP_DOWN,
          reverse=True,
      )
      assert redone == trees[0]
  
      with pytest.raises(AssertionError):
          # turn off reverse - it should fail to rebuild the tree
          redone = reconstruct_tree(
              trees[0],
              transitions[0],
              transition_scheme=TransitionScheme.TOP_DOWN,
          )
          assert redone == trees[0]
  
      transitions = transition_sequence.build_treebank(
          trees,
          transition_scheme=TransitionScheme.IN_ORDER,
          reverse=True,
      )
      with pytest.raises(AssertionError):
          redone = reconstruct_tree(
              trees[0],
              transitions[0],
              transition_scheme=TransitionScheme.IN_ORDER,
              reverse=True,
          )
  
      redone = reconstruct_tree(
          trees[0],
          transitions[0],
          transition_scheme=TransitionScheme.IN_ORDER,
          unary_limit=6,
          reverse=True,
      )
      assert redone == trees[0]
  
      with pytest.raises(AssertionError):
          # turn off reverse - it should fail to rebuild the tree
          redone = reconstruct_tree(
              trees[0],
              transitions[0],
              transition_scheme=TransitionScheme.IN_ORDER,
              unary_limit=6,
          )
          assert redone == trees[0]
  
imports: import pytest
  from stanza.models.constituency import parse_transitions
  from stanza.models.constituency import transition_sequence
  from stanza.models.constituency import tree_reader
  from stanza.models.constituency.base_model import SimpleModel, UNARY_LIMIT
  from stanza.models.constituency.parse_transitions import *
  from stanza.tests import *
  from stanza.tests.constituency.test_parse_tree import CHINESE_LONG_LIST_TREE
label_desc: Use image node_id 12 for calling a global function with example usage: test_chinese_tree_reversed() without return types