class_docstr: A specific iterator for reading trees from a tree file
  
  The idea is that this will keep track of which line
  we are processing, so that an error can be logged
  from the correct line
class_docstr_tok: ["A","specific","iterator","for","reading","trees","from","a","tree","file","The","idea","is","that","this","will","keep","track","of","which","line","we","are","processing",",","so","that","an","error","can","be","logged","from","the","correct","line"]
code: def __next__(self):
      n = next(self.token_iterator, None)
      while n is None:
          self.line_num = self.line_num + 1
          line = next(self.line_iterator)
          if line is None:
              raise StopIteration
          line = line.strip()
          if not line:
              continue
  
          pieces = LINE_SPLIT_RE.split(line)
          pieces = [x.strip() for x in pieces]
          pieces = [x for x in pieces if x]
          self.token_iterator = iter(pieces)
          n = next(self.token_iterator, None)
  
      return n
  
imports: from collections import deque
  import logging
  import os
  import re
  from stanza.models.constituency.parse_tree import Tree
  from stanza.utils.get_tqdm import get_tqdm
label_desc: Use image node_id 5 for calling the TokenIterator obj's underlying member method code with example usage: obj.__next__() and returns: n