def introspect(self, request):
    (client_id, client_secret) = self._get_api_client_credentials(request)
    if ((not client_id) or (not client_secret)):
        response = create_commercetools_response(request, status_code=401)
        return response
    if self.model.is_valid(client_id, client_secret):
        token = request.qs.get('token', [None])[0]
        stored_tokens = [token_object.get('access_token') for token_object in self.model.tokens]
        if (token in stored_tokens):
            status = {'active': True, 'scope': 'manage_project:todo', 'exp': self._expire_time}
        else:
            status = {'active': False}
        response = create_commercetools_response(request, json=status)
        return response
def introspect(self, request):
    (client_id, client_secret) = self._get_api_client_credentials(request)
    if ((not client_id) or (not client_secret)):
        response = create_commercetools_response(request, status_code=401)
        return response
    if self.model.is_valid(client_id, client_secret):
        token = request.qs.get('token', [None])[0]
        stored_tokens = [token_object.get('access_token') for token_object in self.model.tokens]
        if (token in stored_tokens):
            status = {'active': True, 'scope': 'manage_project:todo', 'exp': self._expire_time}
        else:
            status = {'active': False}
        response = create_commercetools_response(request, json=status)
        return response