def _colorize(self, msg, color=None, encode=False):
<EOL>colors = {<EOL>'<STR_LIT>':    '<STR_LIT>',<EOL>'<STR_LIT>':  '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>'<EOL>}<EOL>if not color or not color in colors:<EOL><INDENT>return msg<EOL><DEDENT>if encode:<EOL><INDENT>return u'<STR_LIT>'.format(colors[color], msg)<EOL><DEDENT>return '<STR_LIT>'.format(colors[color], msg)<EOL>
Colorize a string.