Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def Apply(self, request, context):
logging.info("Starting Apply")
entities = AnalyzerEngine.__convert_fields_to_entities(
request.analyzeTemplate.fields)
language = AnalyzerEngine.get_language_from_request(request)
results = self.analyze(request.text, entities, language,
request.analyzeTemplate.allFields)
# Create Analyze Response Object
response = analyze_pb2.AnalyzeResponse()
# pylint: disable=no-member
response.analyzeResults.extend(
AnalyzerEngine.__convert_results_to_proto(results))
logging.info("Found %d results", len(results))
return response