Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
raise ValueError(
"Pattern recognizer should be initialized with patterns"
" or with black list")
super().__init__(supported_entities=[supported_entity],
supported_language=supported_language,
name=name,
version=version)
if patterns is None:
self.patterns = []
else:
self.patterns = patterns
self.context = context
if black_list:
black_list_pattern = PatternRecognizer.__black_list_to_regex(
black_list)
self.patterns.append(black_list_pattern)
self.black_list = black_list
else:
self.black_list = []