Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _is_valid(self, value):
return util.isstr(value)
def __init__(self, *args, **kwargs):
self.regex_name = kwargs.pop('name', None)
flags = 0
for k, v in util.get_iter(self._regex_flags):
flags |= v if kwargs.pop(k, False) else 0
self.regexes = [re.compile(arg, flags) for arg in args if util.isstr(arg)]
super(Regex, self).__init__(*args, **kwargs)
def _is_valid(self, value):
return isinstance(value, Sequence) and not util.isstr(value)