def METHOD_NAME(f):
    pattern = re.compile(r'[^\n]*\s+\n$')
    last_line = "\n"
    lineno = 1
    errors = set()
    for line in f:
        if pattern.match(line):
            errors.add(lineno)
        last_line = line
        lineno += 1
    return errors, last_line