Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, ctx, label, start, end):
super(LocationResult, self).__init__(ctx, label, start, end)
self.countries = self.resolver.get_countries(label)
class LanguageResult(Result):
category = ExtractedEntity.LANGUAGE
def __init__(self, ctx, label, start, end):
label = label.strip().lower()
super(LanguageResult, self).__init__(ctx, label, start, end)
class IPAddressResult(Result):
"""Pull IPv4, IPv6 - and validate using on-board Python tools."""
category = ExtractedEntity.IPADDRESS
def __init__(self, ctx, label, start, end):
super(IPAddressResult, self).__init__(ctx, label, start, end)
try:
ip = ip_address(label)
self.key = self.label = str(ip)
except ValueError:
self.valid = False
class EmailResult(Result):
category = ExtractedEntity.EMAIL
def __init__(self, ctx, label, start, end):
super(EmailResult, self).__init__(ctx, label, start, end)
self.key = self.label_key(self.label)