@classmethod
    def parseFormatting(cls, formatting):
        fore = -1  # -1 default means "use default", not "use white/black"
        back = -1
        other = 0
        intValues = [int(value) for value in formatting.split(';') if value]
        for code in intValues:
            if (code >= cls.FOREGROUND_RANGE.bottom
                    and code <= cls.FOREGROUND_RANGE.top):
                fore = code - cls.FOREGROUND_RANGE.bottom
            elif (code >= cls.BACKGROUND_RANGE.bottom
                  and code <= cls.BACKGROUND_RANGE.top):
                back = code - cls.BACKGROUND_RANGE.bottom
            elif code == cls.BOLD_ATTRIBUTE:
                other = other | curses.A_BOLD
            elif code == cls.UNDERLINE_ATTRIBUTE:
                other = other | curses.A_UNDERLINE

        return (fore, back, other)
Parse ANSI formatting; the formatting passed in should be
dataset/ETHPy150Open facebook/PathPicker/src/formattedText.py/FormattedText.parseFormatting