def _get_final_tree(s):
 tokenized = tokenizer.parseString(s)
 parsed = parser.parse(tokenized)
 merged = _merge_children(parsed, {'S', 'group'})
 final = _clean_parse_tree(merged)
 return final

def _get_final_tree ( s ) : tokenized = tokenizer . parseString ( s ) parsed = parser . parse ( tokenized ) merged = _merge_children ( parsed , { 'S' , 'group' } ) final = _clean_parse_tree ( merged ) return final
return final tree after merge and clean .