def _tree_to_bitstrs(tree):
 clades_bitstrs = {}
 term_names = [term.name for term in tree.find_clades(terminal=True)]
 for clade in tree.find_clades(terminal=False):
  bitstr = _clade_to_bitstr(clade, term_names)
  clades_bitstrs[clade] = bitstr
 return clades_bitstrs

def _tree_to_bitstrs ( tree ) : clades_bitstrs = { } term_names = [ term . name for term in tree . find_clades ( terminal = True ) ] for clade in tree . find_clades ( terminal = False ) : bitstr = _clade_to_bitstr ( clade , term_names ) clades_bitstrs [ clade ] = bitstr return clades_bitstrs
create a dict of a trees clades to corresponding bitstrings .