code: def add_tree_nodes(proto_tree, tree, score):
      # add an open node
      node = proto_tree.nodes.add()
      node.openNode = True
      if score is not None:
          node.score = score
  
      # add the content of this node
      node = proto_tree.nodes.add()
      node.value = tree.label
  
      # add all children...
      # leaves get just one node
      # branches are called recursively
      for child in tree.children:
          if child.is_leaf():
              node = proto_tree.nodes.add()
              node.value = child.label
          else:
              add_tree_nodes(proto_tree, child, None)
  
      node = proto_tree.nodes.add()
      node.closeNode = True
  
imports: from collections import deque
  import subprocess
  from stanza.models.common.utils import misc_to_space_after
  from stanza.models.constituency.parse_tree import Tree
  from stanza.protobuf import DependencyGraph, FlattenedParseTree
  from stanza.server.client import resolve_classpath
label_desc: Use image node_id 2 for calling a global function with example usage: add_tree_nodes(proto_tree, tree, score) without return types