@staticmethod
def fix_whitespace(line, cnt=4):
    """ Replace all tabs with spaces (4 by default). """
    tabs = 0
    while line.startswith('\t'):
        tabs += 1
        line = line[1:]
    spaces = ' ' * cnt
    return ''.join((spaces * tabs, line))
