def hash_trees(self):
observed = {}<EOL>for idx, tree in enumerate(self.treelist):<EOL><INDENT>nwk = tree.write(tree_format=<NUM_LIT:9>)<EOL>hashed = md5(nwk.encode("<STR_LIT:utf-8>")).hexdigest()<EOL>if hashed not in observed:<EOL><INDENT>observed[hashed] = idx<EOL>self.treedict[idx] = <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>idx = observed[hashed]<EOL>self.treedict[idx] += <NUM_LIT:1><EOL><DEDENT><DEDENT>
hash ladderized tree topologies