class_docstr: A data structure to represent a parse tree
class_docstr_tok: ["A","data","structure","to","represent","a","parse","tree"]
docstr: Walks over all of the trees and gets the most frequently occurring words.
docstr_tok: ["Walks","over","all","of","the","trees","and","gets","the","most","frequently","occurring","words","."]
code: def get_common_words(trees, num_words):
      """
      Walks over all of the trees and gets the most frequently occurring words.
      """
      if num_words == 0:
          return set()
  
      if isinstance(trees, Tree):
          trees = [trees]
  
      words = Counter()
      for tree in trees:
          tree.visit_preorder(leaf=lambda x: words.update([x.label]))
      return sorted(x[0] for x in words.most_common()[:num_words])
  
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 18 for calling the Tree obj's underlying member method code with example usage: obj.get_common_words(trees, num_words) and returns: sorted, set