from typing import OrderedDict


def _remove_duplicates(annotation_tuples):
    """Remove duplicates from annotation_tuples without changing the order."""
    new_annotations = OrderedDict()
    for a, new_name in annotation_tuples:
        if a not in new_annotations or new_name is not None:
            new_annotations[a] = new_name
    return list(new_annotations.items())