code: def _print(self, tree, prefix, carryon):
          
          level = prefix.count(self.cross) + prefix.count(self.vline)
          len_children = 0
          if isinstance(tree , _Node):
              len_children = len(tree.children)
  
          # add vertex
          prefix += str(tree)
          # and as many spaces as the vertex is long
          carryon += self.space * len(str(tree))
          if (level == self.maxdepth) or (not isinstance(tree, _Node)) or\
             (len_children == 0):
              self.stream.write(prefix+'\n')
              return
          else:
              # add in between connections
              prefix += self.hline
              carryon += self.space
              # if there is more than one branch, add a cross
              if len(tree.children) > 1:
                  prefix += self.cross
                  carryon += self.vline
              prefix += self.hline
              carryon += self.space
  
              if len_children > 0:
                  # print the first branch (on the same line)
                  self._print(tree.children[0], prefix, carryon)
                  for b in range(1, len_children):
                      # the caryon becomes the prefix for all following children
                      prefix = carryon[:-2] + self.cross + self.hline
                      # remove the vlines for any children of last branch
                      if b == (len_children-1):
                          carryon = carryon[:-2] + 2*self.space
                      self._print(tree.children[b], prefix, carryon)
                      # leave a free line before the next branch
                      if b == (len_children-1):
                          if len(carryon.strip(' ')) == 0:
                              return
                          self.stream.write(carryon[:-2].rstrip()+'\n')
docs: Compute and print a new line of the tree.
  
          This is a recursive function.
  
          arguments
          tree -- tree to print
          prefix -- prefix to the current line to print
          carryon -- prefix which is used to carry on the vertical lines