def reject_duplicates(ordered_pairs):
    """Reject duplicate keys."""
    unique_dict = {}
    for key, val in ordered_pairs:
        if key in unique_dict:
            raise KeyError('Duplicate key: %r' % (key,))
        else:
            unique_dict[key] = val
    return unique_dict
