code: def treepositions_no_leaves(tree):
      """
      Returns all the tree positions in the given tree which are not
      leaf nodes.
      """
      treepositions = tree.treepositions()
      # leaves are treeposition tuples that are not prefixes of any
      # other treeposition
      prefixes = set()
      for pos in treepositions:
          for length in range(len(pos)):
              prefixes.add(pos[:length])
      return [pos for pos in treepositions if pos in prefixes]
  
imports: import functools
  import re
  import nltk.tree
label_desc: Use image node_id 29 for calling a global function with example usage: treepositions_no_leaves(tree) and returns: unknown