def _collect_duplicates(data_list):
    """Collects duplicate items from a list and returns them.

    :param data_list: A list of items to check for duplicates. The list may
        include dict items.
    :returns: A set of items that are duplicates in data_list. If no
        duplicates are found, the returned set is empty.
    """
    seen = []
    dups = set()
    for datum in data_list:
        if datum in seen:
            dups.add(datum)
            continue
        seen.append(datum)
    return dups