def get_duplicates(iterable):
    """Return a set of the elements which appear multiple times in iterable."""
    seen, duplicates = set(), set()
    for elem in iterable:
        if elem in seen:
            duplicates.add(elem)
        else:
            seen.add(elem)
    return duplicates