def sub_retab(match):
before = match.group(<NUM_LIT:1>)<EOL>tabs = len(match.group(<NUM_LIT:2>))<EOL>return before + ('<STR_LIT:U+0020>' * (TAB_SIZE * tabs - len(before) % TAB_SIZE))<EOL>
r"""Remove all tabs and convert them into spaces.

    PARAMETERS:
    match -- regex match; uses re_retab pattern: \1 is text before tab,
             \2 is a consecutive string of tabs.

    A simple substitution of 4 spaces would result in the following:

        to\tlive    # original
        to    live  # simple substitution

    Instead, we convert tabs like the following:

        to\tlive    # original
        to  live    # the tab *looks* like two spaces, so we convert
                    # it to two spaces