def format2(self, raw, out = None, scheme = '<STR_LIT>'):
string_output = <NUM_LIT:0><EOL>if out == '<STR_LIT:str>' or self.out == '<STR_LIT:str>' orisinstance(self.out,io.StringIO):<EOL><INDENT>out_old = self.out<EOL>self.out = io.StringIO()<EOL>string_output = <NUM_LIT:1><EOL><DEDENT>elif out is not None:<EOL><INDENT>self.out = out<EOL><DEDENT>if scheme == '<STR_LIT>':<EOL><INDENT>error = False<EOL>self.out.write(raw)<EOL>if string_output:<EOL><INDENT>return raw,error<EOL><DEDENT>else:<EOL><INDENT>return None,error<EOL><DEDENT><DEDENT>colors = self.color_table[scheme].colors<EOL>self.colors = colors <EOL>self.raw = raw.expandtabs().rstrip()<EOL>self.lines = [<NUM_LIT:0>, <NUM_LIT:0>]<EOL>pos = <NUM_LIT:0><EOL>raw_find = self.raw.find<EOL>lines_append = self.lines.append<EOL>while <NUM_LIT:1>:<EOL><INDENT>pos = raw_find('<STR_LIT:\n>', pos) + <NUM_LIT:1><EOL>if not pos: break<EOL>lines_append(pos)<EOL><DEDENT>lines_append(len(self.raw))<EOL>self.pos = <NUM_LIT:0><EOL>text = io.StringIO(self.raw)<EOL>error = False<EOL>try:<EOL><INDENT>for atoken in generate_tokens(text.readline):<EOL><INDENT>self(*atoken)<EOL><DEDENT><DEDENT>except tokenize.TokenError as ex:<EOL><INDENT>msg = ex.args[<NUM_LIT:0>]<EOL>line = ex.args[<NUM_LIT:1>][<NUM_LIT:0>]<EOL>self.out.write("<STR_LIT>" %<EOL>(colors[token.ERRORTOKEN],<EOL>msg, self.raw[self.lines[line]:],<EOL>colors.normal)<EOL>)<EOL>error = True<EOL><DEDENT>self.out.write(colors.normal+'<STR_LIT:\n>')<EOL>if string_output:<EOL><INDENT>output = self.out.getvalue()<EOL>self.out = out_old<EOL>return (output, error)<EOL><DEDENT>return (None, error)<EOL>
Parse and send the colored source.

        If out and scheme are not specified, the defaults (given to
        constructor) are used.

        out should be a file-type object. Optionally, out can be given as the
        string 'str' and the parser will automatically return the output in a
        string.