code: def count_paren_parity(tree):
      """
      Checks if the tree is properly closed
      :param tree: tree as a string
      :return: True if closed otherwise False
      """
      count = 0
      for char in tree:
          if char == "(":
              count += 1
          elif char == ")":
              count -= 1
      return count
  
file_path: stanza/stanza/utils/datasets/constituency/vtb_convert.py
imports: import argparse
  import os
  from collections import defaultdict
  from stanza.models.constituency.tree_reader import read_trees, MixedTreeError, UnlabeledTreeError
label_desc: Use image node_id 2 for calling a global function with example usage: count_paren_parity(tree) and returns: count