def get_node_dict(self, return_internal=False, return_nodes=False):
if return_internal:<EOL><INDENT>if return_nodes:<EOL><INDENT>return {<EOL>i.idx: i for i in self.treenode.traverse("<STR_LIT>")<EOL>}<EOL><DEDENT>else:<EOL><INDENT>return {<EOL>i.idx: i.name for i in self.treenode.traverse("<STR_LIT>")<EOL>}<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if return_nodes:<EOL><INDENT>return {<EOL>i.idx: i for i in self.treenode.traverse("<STR_LIT>")<EOL>if i.is_leaf()<EOL>}<EOL><DEDENT>else:<EOL><INDENT>return {<EOL>i.idx: i.name for i in self.treenode.traverse("<STR_LIT>")<EOL>if i.is_leaf()<EOL>}<EOL><DEDENT><DEDENT>
Return node labels as a dictionary mapping {idx: name} where idx is 
the order of nodes in 'preorder' traversal. Used internally by the
func .get_node_values() to return values in proper order. 

return_internal: if True all nodes are returned, if False only tips.
return_nodes: if True returns TreeNodes, if False return node names.