def create_tip_index(tree):
 if hasattr(tree, '_tip_index'):
  return
 else:
  tree._tip_index = {n.Name: n for n in tree.tips()}

def create_tip_index ( tree ) : if hasattr ( tree , '_tip_index' ) : return else : tree . _tip_index = { n . Name : n for n in tree . tips ( ) }
create a tip lookup index on the tree .