def expandtabs(charindex, line):
    """Expand the tabs in line. Return the equivalent character
    index to charindex and the expanded line."""
    expandedline = line.expandtabs()
    prefix = line[:charindex].expandtabs()
    expandedcharindex = len(prefix)
    return (expandedcharindex, expandedline)