import itertools


def get_duplicate_labelling(labelled_diags):
    """ Returns diagrams sharing a Label object with other diagrams.

    :param labelled_diags: List of Diagrams with Label objects assigned
    :return failed_diag_label: List of Diagrams that share a Label object with another Diagram
    """

    failed_diag_label = set(diag for diag in labelled_diags if not diag.label)
    filtered_labelled_diags = [diag for diag in labelled_diags if diag not in failed_diag_label]

    # Identifying cases with the same label:
    for a, b in itertools.combinations(filtered_labelled_diags, 2):
        if a.label == b.label:
            failed_diag_label.add(a)
            failed_diag_label.add(b)

    return failed_diag_label