<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def require(self, *kinds):
 """Get the next token, raising an exception if it doesn't match one of the given kinds, or the input ends. If no kinds are given, returns the next token of any kind."""

        token = self.attempt()
        if not token:
            raise SyntaxError('Unexpected end of input')
        if kinds and token.kind not in kinds:
            raise SyntaxError.unexpected(token, kinds)
        return token