<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def t_trailingwhitespace(self, token):
        ur'.+? \n'
        print "Error: trailing whitespace at line %s in text '%s'" % (token.lexer.lineno + 1, token.value[:-1])
        token.lexer.lexerror = True
        token.lexer.skip(1)