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

def get(self, token):
        '''
        Check the token, returns a 401 if the token is invalid.
        Else open the websocket connection
        '''
        log.debug('In the websocket get method')

        self.token = token
        # close the connection, if not authenticated
        if not self.application.auth.get_tok(token):
            log.debug('Refusing websocket connection, bad token!')
            self.send_error(401)
            return
        super(AllEventsHandler, self).get(token)