def match_alignment_and_tree_sequence_ids(self, sequence_names, tree):
tip_names_count = {}<EOL>for t in tree.leaf_node_iter():<EOL><INDENT>name = t.taxon.label.replace('<STR_LIT:U+0020>','<STR_LIT:_>')<EOL>if name in tip_names_count:<EOL><INDENT>raise Exception("<STR_LIT>" % name)<EOL><DEDENT>else:<EOL><INDENT>tip_names_count[name] = <NUM_LIT:1><EOL><DEDENT><DEDENT>for name in sequence_names:<EOL><INDENT>if name not in tip_names_count:<EOL><INDENT>raise Exception("<STR_LIT>" % name)<EOL><DEDENT>elif tip_names_count[name] > <NUM_LIT:1>:<EOL><INDENT>raise Exception("<STR_LIT>" % name)<EOL><DEDENT>else:<EOL><INDENT>tip_names_count[name] += <NUM_LIT:1><EOL><DEDENT><DEDENT>for name, count in tip_names_count.iteritems():<EOL><INDENT>if count < <NUM_LIT:2>:<EOL><INDENT>raise Exception("<STR_LIT>" % name)<EOL><DEDENT><DEDENT>
Check to make sure that the sequences specified in the alignment
        and the tree are the same, otherwise raise an Exception detailing
        the problem for the user to fix

        Parameters
        ----------
        sequence_names: list of str
            names of sequences to ensure are in the tree
        tree: dendropy.Tree
            tree to find names in