def trim(self):
<EOL>return<EOL>for l in self._levels[-<NUM_LIT:2>::-<NUM_LIT:1>]:<EOL><INDENT>for n in l:<EOL><INDENT>if n.is_leaf:<EOL><INDENT>n.parent.remove_child(n.label)<EOL><DEDENT><DEDENT><DEDENT>self._clear_all_leaves()<EOL>
Trims leaves from tree that are not observed at highest-resolution level

This is a bit hacky-- what it does is