class_docstr: A data structure to represent a parse tree
class_docstr_tok: ["A","data","structure","to","represent","a","parse","tree"]
docstr: Return a copy of the tree, eliminating all nodes which are in one of two categories:
      they are a preterminal -NONE-, such as appears in PTB
        *E* shows up in a VLSP dataset
      they have been pruned to 0 children by the recursive call
docstr_tok: ["Return","a","copy","of","the","tree",",","eliminating","all","nodes","which","are","in","one","of","two","categories",":","they","are","a","preterminal","-NONE-",",","such","as","appears","in","PTB","*","E","*","shows","up","in","a","VLSP","dataset","they","have","been","pruned","to","0","children","by","the","recursive","call"]
code: def prune_none(self):
      """
      Return a copy of the tree, eliminating all nodes which are in one of two categories:
          they are a preterminal -NONE-, such as appears in PTB
            *E* shows up in a VLSP dataset
          they have been pruned to 0 children by the recursive call
      """
      if self.is_leaf():
          return Tree(self.label)
      if self.is_preterminal():
          if (
              self.label == "-NONE-"
              or self.children[0].label in WORDS_TO_PRUNE
          ):
              return None
          return Tree(self.label, Tree(self.children[0].label))
      # must be internal node
      new_children = [child.prune_none() for child in self.children]
      new_children = [
          child for child in new_children if child is not None
      ]
      if len(new_children) == 0:
          return None
      return Tree(self.label, new_children)
  
imports: from collections import deque, Counter
  from enum import Enum
  from io import StringIO
  import itertools
  import re
  import warnings
  from stanza.models.common.stanza_object import StanzaObject
label_desc: Use image node_id 27 for calling the Tree obj's underlying member method code with example usage: obj.prune_none() and returns: Tree, Tree, Tree, None, None