@property
    def color_str(self):
        "Return an escape-coded string to write to the terminal."
        s = self.s
        for k, v in sorted(self.atts.items()):
            # (self.atts sorted for the sake of always acting the same.)
            assert k in xforms, "XXX Do we actually get cases like this?"
            if v is False:
                continue
            elif v is True:
                s = xforms[k](s)
            else:
                s = xforms[k](s, v)
        return s
dataset/ETHPy150Open thomasballinger/curtsies/curtsies/formatstring.py/Chunk.color_str/original