def _get_iface_blocks(data):
    """"Yield interface blocks as pairs of v4 and v6 halves."""
    lines, lines6 = [], []
    crt_lines = lines
    for line in data.splitlines():
        line = line.strip()
        if not line or line.startswith('#'):
            continue
        if 'iface' in line:
            if 'inet6' in line:
                crt_lines = lines6
            if lines:
                yield lines, lines6
            lines[:] = []
            lines6[:] = []
            crt_lines = lines
        crt_lines.append(line)
    if lines:
        yield lines, lines6
