def run(self, service_id, user_id, email, **kwargs):
log = self.get_logger(**kwargs)<EOL>log.info("<STR_LIT>")<EOL>try:<EOL><INDENT>service = Service.objects.get(id=service_id)<EOL>log.info("<STR_LIT>" % (email, service.name))<EOL>response = self.create_token(service.url, email, service.token)<EOL>try:<EOL><INDENT>result = response.json()<EOL>ust, created = UserServiceToken.objects.get_or_create(<EOL>service=service, user_id=user_id, email=email)<EOL>ust.token = result["<STR_LIT>"]<EOL>ust.save()<EOL>log.info(<EOL>"<STR_LIT>" % (email, service.name))<EOL><DEDENT>except Exception:<EOL><INDENT>log.info("<STR_LIT>" % (service.name))<EOL><DEDENT>return "<STR_LIT>" % (email)<EOL><DEDENT>except ObjectDoesNotExist:<EOL><INDENT>logger.error('<STR_LIT>', exc_info=True)<EOL><DEDENT>except SoftTimeLimitExceeded:<EOL><INDENT>logger.error(<EOL>'<STR_LIT>',<EOL>exc_info=True)<EOL><DEDENT>
Create and Retrieve a token from remote service. Save to DB.