code: def read_tree(source):
      cur_text = []
      depth = 0
      while True:
          line = source.readline()
          # Check if we are out of input
          if line == "":
              return None
          # strip whitespace and only use if this contains something
          line = line.strip()
          if line == "":
              continue
          cur_text.append(line)
          # Update depth
          for char in line:
              if char == "(":
                  depth += 1
              elif char == ")":
                  depth -= 1
          # At depth 0 we have a complete tree
          if depth == 0:
              tree = PTBTree()
              tree.set_by_text(" ".join(cur_text))
              return tree
      return None
  
imports: import logging
  import os
  import pickle
  from collections import Counter
  import numpy
  import torch
  from torch.utils import data
label_desc: Use image node_id 1 for calling a global function with example usage: read_tree(source) and returns: None, None, tree