def determine_ambiguous_references(columns: set, definitions: set) -> set:
    """ Return the set of reference names that exist as both a column and a definition. """

    # get the diffs between the two sets
    unambiguous_columns = columns - definitions
    unambiguous_definitions = definitions - columns

    # then, by removing all the unambiguous names, we'll be left with the ambiguous ones
    ambiguous_references = ((columns | definitions) - unambiguous_definitions) - unambiguous_columns

    return ambiguous_references