Accepts an open file or a list of lines.

def parse_doc(f, ctx=None, overwrite=False):
    """ Accepts an open file or a list of lines. """
    lg = LineGetter(f, comment_marker=("#", ";"), strip=False)
    cfg = ConfigParser(ctx).parse_doc(lg)
    set_defaults(cfg)
    if overwrite:
        squash(cfg)
    return cfg