(i, n, simplify=False)
Return a html formated label for a disjoint set indexed by `i`.
Return a html formated label for a disjoint set indexed by `i`.
Return a html formated label for a disjoint set indexed by i .
def disjoint_set_label(i, n, simplify=False):
    """
    Return a html formated label for a disjoint set indexed by `i`.
    """
    intersection = unicodedata.lookup("INTERSECTION")
    # comp = unicodedata.lookup("COMPLEMENT")  #
    # This depends on the font but the unicode complement in
    # general does not look nice in a super script so we use
    # plain c instead.
    comp = "c"

    def label_for_index(i):
        return chr(ord("A") + i)

    if simplify:
        return "".join(label_for_index(i) for i, b in enumerate(setkey(i, n))
                       if b)
    else:
        return intersection.join(label_for_index(i) +
                                 ("" if b else "<sup>" + comp + "</sup>")
                                 for i, b in enumerate(setkey(i, n)))
def disjoint_set_label ( i , n , simplify = False ) : intersection = unicodedata . lookup ( "INTERSECTION" ) # comp = unicodedata.lookup("COMPLEMENT")  # # This depends on the font but the unicode complement in # general does not look nice in a super script so we use # plain c instead. comp = "c" def label_for_index ( i ) : return chr ( ord ( "A" ) + i ) if simplify : return "" . join ( label_for_index ( i ) for i , b in enumerate ( setkey ( i , n ) ) if b ) else : return intersection . join ( label_for_index ( i ) + ( "" if b else "<sup>" + comp + "</sup>" ) for i , b in enumerate ( setkey ( i , n ) ) )