def _format_lines(lines):
result = lines[:<NUM_LIT:1>]<EOL>stack = [<NUM_LIT:0>]<EOL>stackcnt = [<NUM_LIT:0>]<EOL>for line in lines[<NUM_LIT:1>:]:<EOL><INDENT>if line.startswith("<STR_LIT:{>"):<EOL><INDENT>if stackcnt[-<NUM_LIT:1>]:<EOL><INDENT>s = u"<STR_LIT>"<EOL><DEDENT>else:<EOL><INDENT>s = u"<STR_LIT>"<EOL><DEDENT>stack.append(len(result))<EOL>stackcnt[-<NUM_LIT:1>] += <NUM_LIT:1><EOL>stackcnt.append(<NUM_LIT:0>)<EOL>result.append(u"<STR_LIT>" + u"<STR_LIT:U+0020>" * (len(stack) - <NUM_LIT:1>) + s + line[<NUM_LIT:1>:])<EOL><DEDENT>elif line.startswith("<STR_LIT:}>"):<EOL><INDENT>stack.pop()<EOL>stackcnt.pop()<EOL>result[stack[-<NUM_LIT:1>]] += line[<NUM_LIT:1>:]<EOL><DEDENT>else:<EOL><INDENT>assert line[<NUM_LIT:0>] in ["<STR_LIT>", "<STR_LIT:>>"]<EOL>stack[-<NUM_LIT:1>] += <NUM_LIT:1><EOL>indent = len(stack) if line.startswith("<STR_LIT>") else len(stack) - <NUM_LIT:1><EOL>result.append(u"<STR_LIT:U+0020>" * indent + line[<NUM_LIT:1>:])<EOL><DEDENT><DEDENT>assert len(stack) == <NUM_LIT:1><EOL>return result<EOL>
Format the individual lines

    This will replace the '{', '}' and '~' characters of our mini
    formatting language with the proper 'where ...', 'and ...' and ' +
    ...' text, taking care of indentation along the way.

    Return a list of formatted lines.