human
Complete this python program:
def _preprocess(config_string):
assistant
#Here is the Python program you requested.

    """Convert a raw config into a form that preserves comments etc.
    """
    results = [u'[__COMMENTS__]']
    counter = itertools.count(0)
    section_re = re.compile(u'^(\\[[^\\]]+\\])\\s*(.+)$')
    blank_line_re = re.compile(u'^\\s*$')
    comment_re = re.compile(u'^(#|;)')
    inline_comment_re = re.compile(u'    ;')
    def newlines(match):
        return (u'__BLANK%d__    =' % next(counter))
    def comments(match):
        if (match.group(1) == u'#'):
            return (u'__HASH%d__    =' % next(counter))
        elif (match.group(1) == u';'):
            return (u'__SEMICOLON%d__    =' % next(counter))
    def inlinecomments(match):
        return (u'\n__INLINE%d__    =' % next(counter))
    def sections(match):
        return (u'%s\n__SECTION%d__    =    %s' % (match.group(1), next(counter), match.group(2)))
    for line in config_string.splitlines():
        line = blank_line_re.sub(newlines, line)
        line = section_re.sub(sections, line)
        line = comment_re.sub(comments, line)
        line = inline_comment_re.sub(inlinecomments, line)
        results.append(line)
    return u'\n'.join(results)