Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __or__(self, x):
# Combine results
if isinstance(self, Or):
self.subtree['should'].append(x.subtree)
return self
elif isinstance(x, Or):
x.subtree['should'].append(self.subtree)
return x
return Or(self, x)
def __init__(self, *args):
[isinstance(x, Filter) for x in args]
super(Or, self).__init__()
self._filter = {'bool': {'should': [x.build() for x in args]}}
def __or__(self, x):
# Combine results
if isinstance(self, Or):
self.subtree['should'].append(x.subtree)
return self
elif isinstance(x, Or):
x.subtree['should'].append(self.subtree)
return x
return Or(self, x)
def __or__(self, x):
# Combine results
if isinstance(self, Or):
self.subtree['should'].append(x.subtree)
return self
elif isinstance(x, Or):
x.subtree['should'].append(self.subtree)
return x
return Or(self, x)