def split_sections(s):
section = None<EOL>content = []<EOL>for line in yield_lines(s):<EOL><INDENT>if line.startswith("<STR_LIT:[>"):<EOL><INDENT>if line.endswith("<STR_LIT:]>"):<EOL><INDENT>if section or content:<EOL><INDENT>yield section, content<EOL><DEDENT>section = line[<NUM_LIT:1>:-<NUM_LIT:1>].strip()<EOL>content = []<EOL><DEDENT>else:<EOL><INDENT>raise ValueError("<STR_LIT>", line)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>content.append(line)<EOL><DEDENT><DEDENT>yield section, content<EOL>
Split a string or iterable thereof into (section, content) pairs

    Each ``section`` is a stripped version of the section header ("[section]")
    and each ``content`` is a list of stripped lines excluding blank lines and
    comment-only lines.  If there are any such lines before the first section
    header, they're returned in a first ``section`` of ``None``.