def colorize_text(self, text):

        # Take note of where the escape sequences are.
        rnormal = text.rfind("<<NORMAL")
        rany = text.rfind("<<")

        # Put in the escape sequences.
        text = text.replace("%", "%%")
        text = text.replace("<<", "%(").replace(">>", ")s")

        # Make sure that the last sequence is a NORMAL sequence.
        if rany > -1 and rnormal < rany:
            text += "%(NORMAL)s"

        # Replace our placeholders with the physical sequence data.
        return text % self.colors
Uploads a local file to an object.
dataset/ETHPy150Open mozilla/app-validator/appvalidator/errorbundle/outputhandlers/shellcolors.py/OutputHandler.colorize_text--crossover with--dataset/ETHPy150Open GoogleCloudPlatform/gsutil/gslib/copy_helper.py/_UploadFileToObject