def _get_user_token(self):
        CLIENT_ID = 'codalab_cli_client'
    
        if request.user is None:
            return None
    
        # Try to find an existing token that will work.
        token = local.model.find_oauth2_token(
            CLIENT_ID,
            request.user.user_id,
            datetime.utcnow() + timedelta(minutes=5))
        if token is not None:
            return token.access_token
    
        # Otherwise, generate a new one.
        token = OAuth2Token(
            local.model,
            access_token=generate_token(),
            refresh_token=None,
            scopes='',
            expires=datetime.utcnow() + timedelta(hours=10),
            client_id=CLIENT_ID,
            user_id=request.user.user_id,
        )
        local.model.save_oauth2_token(token)
    
        return token.access_token
Returns an access token for the user. This function facilitates interactions
dataset/ETHPy150Open codalab/codalab-cli/codalab/rest/legacy.py/RemoteBundleService._get_user_token